[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r3661 - trunk/OpenDNSSEC/libhsm/src

Jakob Schlyter jakob at kirei.se
Fri Aug 6 13:35:47 CEST 2010


Author: jakob
Date: 2010-08-06 13:35:47 +0200 (Fri, 06 Aug 2010)
New Revision: 3661

Modified:
   trunk/OpenDNSSEC/libhsm/src/libhsm.c
Log:
more comments

Modified: trunk/OpenDNSSEC/libhsm/src/libhsm.c
===================================================================
--- trunk/OpenDNSSEC/libhsm/src/libhsm.c	2010-08-06 11:03:56 UTC (rev 3660)
+++ trunk/OpenDNSSEC/libhsm/src/libhsm.c	2010-08-06 11:35:47 UTC (rev 3661)
@@ -48,18 +48,13 @@
 
 #include <pkcs11.h>
 
-/* fixed length from PKCS #11 specification */
+/*! Fixed length from PKCS#11 specification */
 #define HSM_TOKEN_LABEL_LENGTH 32
 
-/* we need some globals, for session management, and for the initial
- * context
- */
+/*! Global (initial) context */
 static hsm_ctx_t *_hsm_ctx;
 
-/* PKCS#11 specific functions */
-/*
- * General PKCS11 helper functions
- */
+/*! General PKCS11 helper functions */
 static char *
 ldns_pkcs11_rv_str(CK_RV rv)
 {
@@ -200,11 +195,17 @@
         }
 }
 
-/*
- * If the ctx is given, and it's error value is still 0, the
- * value will be set to 'error', and the error_message and error_action
- * will be set to the given strings
- */
+/*! Set HSM Context Error
+
+If the ctx is given, and it's error value is still 0, the value will be
+set to 'error', and the error_message and error_action will be set to
+the given strings.   
+
+\param ctx      HSM context
+\param error    error code
+\param action   action for which the error occured
+\param message  error message format string
+*/
 static void
 hsm_ctx_set_error(hsm_ctx_t *ctx, int error, const char *action,
                  const char *message, ...)
@@ -222,9 +223,17 @@
     }
 }
 
-/* returns 1 if rv == CKR_OK. If it is not, and if there is no error
- * value set yet, the rv value will be set
- * to the given context (as an integer), and 0 will be returned */
+/*! Check HSM Context for Error
+
+If the rv is not CKR_OK, and there is not previous error registered in
+the context, to set the context error based on PKCS#11 return value.
+
+\param ctx      HSM context
+\param rv       PKCS#11 return value
+\param action   action for which the error occured
+\param message  error message format string
+\return         0 if rv == CKR_OK, otherwise 1
+*/
 static int
 hsm_pkcs11_check_error(hsm_ctx_t *ctx, CK_RV rv, const char *action)
 {
@@ -239,6 +248,7 @@
     return 0;
 }
 
+/*! Unload PKCS#11 provider */
 static void
 hsm_pkcs11_unload_functions(void *handle)
 {
@@ -252,6 +262,7 @@
     }
 }
 
+/*! Load PKCS#11 provider */
 static CK_RV
 hsm_pkcs11_load_functions(hsm_module_t *module)
 {




More information about the Opendnssec-commits mailing list