security/nss/lib/softoken/lgglue.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/lib/softoken/lgglue.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,60 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +/* 
     1.8 + * This code defines the glue layer between softoken and the legacy DB library
     1.9 + */
    1.10 +#include "sdb.h"
    1.11 +
    1.12 +/*
    1.13 + * function prototypes for the callbacks into softoken from the legacyDB
    1.14 + */
    1.15 +
    1.16 +typedef SECStatus (*LGEncryptFunc)(PLArenaPool *arena, SDB *sdb,
    1.17 +				  SECItem *plainText, SECItem **cipherText);
    1.18 +typedef SECStatus (*LGDecryptFunc)(SDB *sdb, SECItem *cipherText, 
    1.19 +				   SECItem **plainText);
    1.20 +
    1.21 +/*
    1.22 + * function prototypes for the exported functions.
    1.23 + */
    1.24 +typedef CK_RV (*LGOpenFunc) (const char *dir, const char *certPrefix, 
    1.25 +		const char *keyPrefix, 
    1.26 +		int certVersion, int keyVersion, int flags, 
    1.27 +		SDB **certDB, SDB **keyDB);
    1.28 +typedef char ** (*LGReadSecmodFunc)(const char *appName, 
    1.29 +			const char *filename, 
    1.30 +			const char *dbname, char *params, PRBool rw);
    1.31 +typedef SECStatus (*LGReleaseSecmodFunc)(const char *appName,
    1.32 +			const char *filename, 
    1.33 +			const char *dbname, char **params, PRBool rw);
    1.34 +typedef SECStatus (*LGDeleteSecmodFunc)(const char *appName,
    1.35 +			const char *filename, 
    1.36 +			const char *dbname, char *params, PRBool rw);
    1.37 +typedef SECStatus (*LGAddSecmodFunc)(const char *appName, 
    1.38 +			const char *filename, 
    1.39 +			const char *dbname, char *params, PRBool rw);
    1.40 +typedef SECStatus (*LGShutdownFunc)(PRBool forked);
    1.41 +typedef void (*LGSetForkStateFunc)(PRBool);
    1.42 +typedef void (*LGSetCryptFunc)(LGEncryptFunc, LGDecryptFunc);
    1.43 +
    1.44 +/*
    1.45 + * Softoken Glue Functions
    1.46 + */
    1.47 +CK_RV sftkdbCall_open(const char *dir, const char *certPrefix, 
    1.48 +		const char *keyPrefix, 
    1.49 +		int certVersion, int keyVersion, int flags, PRBool isFIPS,
    1.50 +		SDB **certDB, SDB **keyDB);
    1.51 +char ** sftkdbCall_ReadSecmodDB(const char *appName, const char *filename, 
    1.52 +			const char *dbname, char *params, PRBool rw);
    1.53 +SECStatus sftkdbCall_ReleaseSecmodDBData(const char *appName, 
    1.54 +			const char *filename, const char *dbname, 
    1.55 +			char **moduleSpecList, PRBool rw);
    1.56 +SECStatus sftkdbCall_DeleteSecmodDB(const char *appName, 
    1.57 +		      const char *filename, const char *dbname, 
    1.58 +		      char *args, PRBool rw);
    1.59 +SECStatus sftkdbCall_AddSecmodDB(const char *appName, 
    1.60 +		   const char *filename, const char *dbname, 
    1.61 +		   char *module, PRBool rw);
    1.62 +CK_RV sftkdbCall_Shutdown(void);
    1.63 +

mercurial