Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Jun 2002 07:27:44 -0700 (PDT)
From:      Dag-Erling Smorgrav <des@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 12819 for review
Message-ID:  <200206131427.g5DERiS09134@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=12819

Change 12819 by des@des.at.des.thinksec.com on 2002/06/13 07:27:00

	Read configuration file every time C_Initialize() is called.
	
	Sponsored by:	DARPA, NAI Labs

Affected files ...

... //depot/projects/cryptoki/lib/C_Initialize.c#4 edit
... //depot/projects/cryptoki/lib/Makefile#4 edit
... //depot/projects/cryptoki/lib/_ck_configure.c#1 add
... //depot/projects/cryptoki/lib/cryptoki_impl.h#2 edit

Differences ...

==== //depot/projects/cryptoki/lib/C_Initialize.c#4 (text+ko) ====

@@ -31,19 +31,19 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $P4: //depot/projects/cryptoki/lib/C_Initialize.c#3 $
+ * $P4: //depot/projects/cryptoki/lib/C_Initialize.c#4 $
  */
 
 #include <cryptoki.h>
 
 #include "cryptoki_impl.h"
 
-int		_ck_Initialized;
+int			_ck_Initialized;
 
-CK_CREATEMUTEX	_ck_CreateMutex;
-CK_DESTROYMUTEX	_ck_DestroyMutex;
-CK_LOCKMUTEX	_ck_LockMutex;
-CK_UNLOCKMUTEX	_ck_UnlockMutex;
+CK_CREATEMUTEX		_ck_CreateMutex;
+CK_DESTROYMUTEX		_ck_DestroyMutex;
+CK_LOCKMUTEX		_ck_LockMutex;
+CK_UNLOCKMUTEX		_ck_UnlockMutex;
 
 CK_RV
 C_Initialize(CK_VOID_PTR pInitArgs)
@@ -60,6 +60,8 @@
 		_ck_UnlockMutex = pArgs->UnlockMutex;
 		/* should check that they're either all set or all clear */
 	}
+	if (_ck_configure() == -1)
+		return (CKR_GENERAL_ERROR);
 
 	_ck_Initialized = TRUE;
 	return (CKR_OK);

==== //depot/projects/cryptoki/lib/Makefile#4 (text+ko) ====

@@ -31,7 +31,7 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 #
-# $P4: //depot/projects/cryptoki/lib/Makefile#3 $
+# $P4: //depot/projects/cryptoki/lib/Makefile#4 $
 #
 
 LIB		 = cryptoki
@@ -42,6 +42,7 @@
 CFLAGS		+= -I${.CURDIR}/../include
 
 SRCS		 =
+SRCS		+= _ck_configure.c
 SRCS		+= C_CancelFunction.c
 SRCS		+= C_CloseAllSessions.c
 SRCS		+= C_CloseSession.c

==== //depot/projects/cryptoki/lib/cryptoki_impl.h#2 (text+ko) ====

@@ -31,19 +31,48 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $P4: //depot/projects/cryptoki/lib/cryptoki_impl.h#1 $
+ * $P4: //depot/projects/cryptoki/lib/cryptoki_impl.h#2 $
  */
 
 #ifndef _CRYPTOKI_IMPL_H_INCLUDED
 #define _CRYPTOKI_IMPL_H_INCLUDED
 
+/* C_Initialize.c */
 extern int		_ck_Initialized;
-
 extern CK_CREATEMUTEX	_ck_CreateMutex;
 extern CK_DESTROYMUTEX	_ck_DestroyMutex;
 extern CK_LOCKMUTEX	_ck_LockMutex;
 extern CK_UNLOCKMUTEX	_ck_UnlockMutex;
 
+/* C_GetInfo.c */
 extern CK_INFO		_ck_Info;
 
+/* C_GetFunctionList.c */
+extern CK_FUNCTION_LIST	_ck_FunctionList;
+
+/* C_GetSlotList.c */
+typedef struct _ck_slot _ck_slot;
+typedef _ck_slot *_ck_slot_ptr;
+struct _ck_slot {
+	CK_ULONG	 cks_id;
+	char		 cks_dev[64];
+	enum {
+		serial,
+		parallel,
+		ugen,
+	}		 cks_type;
+	enum {
+		autodetect,
+		tzero,
+		tone,
+		apdu,
+	}		 cks_protocol;
+};
+
+extern CK_ULONG		_ck_NumSlots;
+extern _ck_slot_ptr	_ck_Slots;
+
+
+int			_ck_configure(void);
+
 #endif

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206131427.g5DERiS09134>