From owner-p4-projects Thu Jun 13 7:29:19 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 213E937B414; Thu, 13 Jun 2002 07:28:24 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 20F5737B616 for ; Thu, 13 Jun 2002 07:27:44 -0700 (PDT) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5DERiS09134 for perforce@freebsd.org; Thu, 13 Jun 2002 07:27:44 -0700 (PDT) (envelope-from des@freebsd.org) Date: Thu, 13 Jun 2002 07:27:44 -0700 (PDT) Message-Id: <200206131427.g5DERiS09134@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to des@freebsd.org using -f From: Dag-Erling Smorgrav Subject: PERFORCE change 12819 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 #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