Skip to content

Commit

Permalink
replace deprecated CK?_NETSCAPE_? constants
Browse files Browse the repository at this point in the history
... with the corresponding CK?_NSS_? constants

Fixes: #6
Closes: #7
  • Loading branch information
pomac303 authored and kdudka committed Aug 7, 2020
1 parent 3e50189 commit e14d5b5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions src/pfind.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,18 +276,18 @@ collect_objects(CK_ATTRIBUTE_PTR pTemplate,
type = pemBareKey;
plog("CKO_PRIVATE_KEY\n");
break;
case CKO_NETSCAPE_TRUST:
case CKO_NSS_TRUST:
type = pemTrust;
plog("CKO_NETSCAPE_TRUST\n");
plog("CKO_NSS_TRUST\n");
break;
case CKO_NETSCAPE_CRL:
plog("CKO_NETSCAPE_CRL\n");
case CKO_NSS_CRL:
plog("CKO_NSS_CRL\n");
goto done;
case CKO_NETSCAPE_SMIME:
plog("CKO_NETSCAPE_SMIME\n");
case CKO_NSS_SMIME:
plog("CKO_NSS_SMIME\n");
goto done;
case CKO_NETSCAPE_BUILTIN_ROOT_LIST:
plog("CKO_NETSCAPE_BUILTIN_ROOT_LIST\n");
case CKO_NSS_BUILTIN_ROOT_LIST:
plog("CKO_NSS_BUILTIN_ROOT_LIST\n");
goto done;
case CK_INVALID_HANDLE:
type = pemAll; /* look through all objectclasses - ignore the type field */
Expand Down
8 changes: 4 additions & 4 deletions src/pinst.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ CreateObject(CK_OBJECT_CLASS objClass,
/* more unique nicknames - https://bugzilla.redhat.com/689031#c66 */
nickname = filename;
break;
case CKO_NETSCAPE_TRUST:
case CKO_NSS_TRUST:
plog("Creating trust nick %s id %ld in slot %ld\n", nickname, objid, slotID);
memset(&o->u.trust, 0, sizeof(o->u.trust));
break;
Expand Down Expand Up @@ -265,7 +265,7 @@ CreateObject(CK_OBJECT_CLASS objClass,

switch (objClass) {
case CKO_CERTIFICATE:
case CKO_NETSCAPE_TRUST:
case CKO_NSS_TRUST:
if (SECSuccess != GetCertFields(o->derCert->data, o->derCert->len,
&issuer, &serial, &derSN, &subject,
&valid, &subjkey))
Expand Down Expand Up @@ -344,7 +344,7 @@ derEncodingsMatch(CK_OBJECT_CLASS objClass, pemInternalObject * obj,

switch (objClass) {
case CKO_CERTIFICATE:
case CKO_NETSCAPE_TRUST:
case CKO_NSS_TRUST:
result = SECITEM_CompareItem(obj->derCert, certDER);
break;

Expand Down Expand Up @@ -497,7 +497,7 @@ AddCertificate(char *certfile, char *keyfile, PRBool cacert,
nickname, 0, slotID, NULL);
if (o != NULL) {
/* Add the CA trust object */
o = AddObjectIfNeeded(CKO_NETSCAPE_TRUST, pemTrust, objs[i], NULL,
o = AddObjectIfNeeded(CKO_NSS_TRUST, pemTrust, objs[i], NULL,
nickname, 0, slotID, NULL);
}
if (o == NULL) {
Expand Down
10 changes: 5 additions & 5 deletions src/pobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ static const CK_KEY_TYPE ckk_rsa = CKK_RSA;
static const CK_OBJECT_CLASS cko_certificate = CKO_CERTIFICATE;
static const CK_OBJECT_CLASS cko_private_key = CKO_PRIVATE_KEY;
static const CK_OBJECT_CLASS cko_public_key = CKO_PUBLIC_KEY;
static const CK_OBJECT_CLASS cko_trust = CKO_NETSCAPE_TRUST;
static const CK_TRUST ckt_netscape_trusted = CKT_NETSCAPE_TRUSTED_DELEGATOR;
static const CK_OBJECT_CLASS cko_trust = CKO_NSS_TRUST;
static const CK_TRUST ckt_netscape_trusted = CKT_NSS_TRUSTED_DELEGATOR;
static const NSSItem pem_trueItem = {
(void *) &ck_true, (PRUint32) sizeof(CK_BBOOL)
};
Expand Down Expand Up @@ -578,7 +578,7 @@ pem_FetchAttribute
return pem_FetchCertAttribute(io, type);
case CKO_PRIVATE_KEY:
return pem_FetchPrivKeyAttribute(io, type, pError);
case CKO_NETSCAPE_TRUST:
case CKO_NSS_TRUST:
return pem_FetchTrustAttribute(io, type);
case CKO_PUBLIC_KEY:
return pem_FetchPubKeyAttribute(io, type);
Expand Down Expand Up @@ -775,7 +775,7 @@ pem_mdObject_GetAttributeCount
return pubKeyAttrsCount;
case CKO_PRIVATE_KEY:
return privKeyAttrsCount;
case CKO_NETSCAPE_TRUST:
case CKO_NSS_TRUST:
return trustAttrsCount;
default:
break;
Expand Down Expand Up @@ -1168,7 +1168,7 @@ pem_CreateObject
if (listItem->io != NULL) {
/* Add the trust object */
APPEND_LIST_ITEM(listItem);
listItem->io = AddObjectIfNeeded(CKO_NETSCAPE_TRUST, pemTrust,
listItem->io = AddObjectIfNeeded(CKO_NSS_TRUST, pemTrust,
derlist[c], NULL, nickname, 0,
slotID, NULL);
}
Expand Down

0 comments on commit e14d5b5

Please sign in to comment.