Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | /* |
michael@0 | 5 | * This code defines the glue layer between softoken and the legacy DB library |
michael@0 | 6 | */ |
michael@0 | 7 | #include "sdb.h" |
michael@0 | 8 | |
michael@0 | 9 | /* |
michael@0 | 10 | * function prototypes for the callbacks into softoken from the legacyDB |
michael@0 | 11 | */ |
michael@0 | 12 | |
michael@0 | 13 | typedef SECStatus (*LGEncryptFunc)(PLArenaPool *arena, SDB *sdb, |
michael@0 | 14 | SECItem *plainText, SECItem **cipherText); |
michael@0 | 15 | typedef SECStatus (*LGDecryptFunc)(SDB *sdb, SECItem *cipherText, |
michael@0 | 16 | SECItem **plainText); |
michael@0 | 17 | |
michael@0 | 18 | /* |
michael@0 | 19 | * function prototypes for the exported functions. |
michael@0 | 20 | */ |
michael@0 | 21 | typedef CK_RV (*LGOpenFunc) (const char *dir, const char *certPrefix, |
michael@0 | 22 | const char *keyPrefix, |
michael@0 | 23 | int certVersion, int keyVersion, int flags, |
michael@0 | 24 | SDB **certDB, SDB **keyDB); |
michael@0 | 25 | typedef char ** (*LGReadSecmodFunc)(const char *appName, |
michael@0 | 26 | const char *filename, |
michael@0 | 27 | const char *dbname, char *params, PRBool rw); |
michael@0 | 28 | typedef SECStatus (*LGReleaseSecmodFunc)(const char *appName, |
michael@0 | 29 | const char *filename, |
michael@0 | 30 | const char *dbname, char **params, PRBool rw); |
michael@0 | 31 | typedef SECStatus (*LGDeleteSecmodFunc)(const char *appName, |
michael@0 | 32 | const char *filename, |
michael@0 | 33 | const char *dbname, char *params, PRBool rw); |
michael@0 | 34 | typedef SECStatus (*LGAddSecmodFunc)(const char *appName, |
michael@0 | 35 | const char *filename, |
michael@0 | 36 | const char *dbname, char *params, PRBool rw); |
michael@0 | 37 | typedef SECStatus (*LGShutdownFunc)(PRBool forked); |
michael@0 | 38 | typedef void (*LGSetForkStateFunc)(PRBool); |
michael@0 | 39 | typedef void (*LGSetCryptFunc)(LGEncryptFunc, LGDecryptFunc); |
michael@0 | 40 | |
michael@0 | 41 | /* |
michael@0 | 42 | * Softoken Glue Functions |
michael@0 | 43 | */ |
michael@0 | 44 | CK_RV sftkdbCall_open(const char *dir, const char *certPrefix, |
michael@0 | 45 | const char *keyPrefix, |
michael@0 | 46 | int certVersion, int keyVersion, int flags, PRBool isFIPS, |
michael@0 | 47 | SDB **certDB, SDB **keyDB); |
michael@0 | 48 | char ** sftkdbCall_ReadSecmodDB(const char *appName, const char *filename, |
michael@0 | 49 | const char *dbname, char *params, PRBool rw); |
michael@0 | 50 | SECStatus sftkdbCall_ReleaseSecmodDBData(const char *appName, |
michael@0 | 51 | const char *filename, const char *dbname, |
michael@0 | 52 | char **moduleSpecList, PRBool rw); |
michael@0 | 53 | SECStatus sftkdbCall_DeleteSecmodDB(const char *appName, |
michael@0 | 54 | const char *filename, const char *dbname, |
michael@0 | 55 | char *args, PRBool rw); |
michael@0 | 56 | SECStatus sftkdbCall_AddSecmodDB(const char *appName, |
michael@0 | 57 | const char *filename, const char *dbname, |
michael@0 | 58 | char *module, PRBool rw); |
michael@0 | 59 | CK_RV sftkdbCall_Shutdown(void); |
michael@0 | 60 |