diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /security/nss/lib/softoken/sftkdbti.h | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'security/nss/lib/softoken/sftkdbti.h')
-rw-r--r-- | security/nss/lib/softoken/sftkdbti.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/security/nss/lib/softoken/sftkdbti.h b/security/nss/lib/softoken/sftkdbti.h new file mode 100644 index 000000000..4942e1b12 --- /dev/null +++ b/security/nss/lib/softoken/sftkdbti.h @@ -0,0 +1,58 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef SFTKDBTI_H +#define SFTKDBTI_H 1 + +/* + * private defines + */ +struct SFTKDBHandleStr { + SDB *db; + PRInt32 ref; + CK_OBJECT_HANDLE type; + SECItem passwordKey; + SECItem *newKey; + SECItem *oldKey; + SECItem *updatePasswordKey; + PZLock *passwordLock; + SFTKDBHandle *peerDB; + SDB *update; + char *updateID; + PRBool updateDBIsInit; +}; + +#define SFTK_KEYDB_TYPE 0x40000000 +#define SFTK_CERTDB_TYPE 0x00000000 +#define SFTK_OBJ_TYPE_MASK 0xc0000000 +#define SFTK_OBJ_ID_MASK (~SFTK_OBJ_TYPE_MASK) +#define SFTK_TOKEN_TYPE 0x80000000 + +/* the following is the number of id's to handle on the stack at a time, + * it's not an upper limit of IDS that can be stored in the database */ +#define SFTK_MAX_IDS 10 + +#define SFTK_GET_SDB(handle) \ + ((handle)->update ? (handle)->update : (handle)->db) + +SECStatus sftkdb_DecryptAttribute(SECItem *passKey, SECItem *cipherText, + SECItem **plainText); +SECStatus sftkdb_EncryptAttribute(PLArenaPool *arena, SECItem *passKey, + SECItem *plainText, SECItem **cipherText); +SECStatus sftkdb_SignAttribute(PLArenaPool *arena, SECItem *passKey, + CK_OBJECT_HANDLE objectID, + CK_ATTRIBUTE_TYPE attrType, + SECItem *plainText, SECItem **sigText); +SECStatus sftkdb_VerifyAttribute(SECItem *passKey, + CK_OBJECT_HANDLE objectID, + CK_ATTRIBUTE_TYPE attrType, + SECItem *plainText, SECItem *sigText); + +void sftk_ULong2SDBULong(unsigned char *data, CK_ULONG value); +CK_RV sftkdb_Update(SFTKDBHandle *handle, SECItem *key); +CK_RV sftkdb_PutAttributeSignature(SFTKDBHandle *handle, + SDB *keyTarget, CK_OBJECT_HANDLE objectID, + CK_ATTRIBUTE_TYPE type, SECItem *signText); + +#endif |