Skip to content

Commit

Permalink
Bug 1558313 - Fix clang warnings in pk11importtest.c and pkcs11.c r=m…
Browse files Browse the repository at this point in the history
…arcusburghardt

Differential Revision: https://phabricator.services.mozilla.com/D41486

--HG--
extra : moz-landing-system : lando
  • Loading branch information
jecarr committed Sep 16, 2019
1 parent f12b1a5 commit 6613bf3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion cmd/pk11importtest/pk11importtest.c
Expand Up @@ -176,7 +176,9 @@ handleEncryptedPrivateImportTest(char *progName, PK11SlotInfo *slot,
}
SECITEM_FreeItem(&pubValue, PR_FALSE);
SECITEM_FreeItem(&privID, PR_FALSE);
PORT_FreeArena(epki->arena, PR_TRUE);
if (epki && epki->arena) {
PORT_FreeArena(epki->arena, PR_TRUE);
}
SECKEY_DestroyPublicKey(pubKey);
SECKEY_DestroyPrivateKey(privKey);
fprintf(stderr, "%s PrivateKeyImport %s ***********************\n",
Expand Down
9 changes: 7 additions & 2 deletions lib/softoken/pkcs11.c
Expand Up @@ -2285,14 +2285,19 @@ sftk_PutPubKey(SFTKObject *publicKey, SFTKObject *privateKey, CK_KEY_TYPE keyTyp
default:
return CKR_KEY_TYPE_INCONSISTENT;
}
if (crv != CKR_OK) {
return crv;
}
crv = sftk_AddAttributeType(publicKey, CKA_CLASS, &classType,
sizeof(CK_OBJECT_CLASS));
if (crv != CKR_OK)
if (crv != CKR_OK) {
return crv;
}
crv = sftk_AddAttributeType(publicKey, CKA_KEY_TYPE, &keyType,
sizeof(CK_KEY_TYPE));
if (crv != CKR_OK)
if (crv != CKR_OK) {
return crv;
}
/* now handle the operator attributes */
if (sftk_isTrue(privateKey, CKA_DECRYPT)) {
crv = sftk_forceAttribute(publicKey, CKA_ENCRYPT, &cktrue, sizeof(CK_BBOOL));
Expand Down

0 comments on commit 6613bf3

Please sign in to comment.