andre@0: diff -r 3f0105dfc733 lib/pk11wrap/pk11akey.c andre@0: --- a/lib/pk11wrap/pk11akey.c Mon Apr 22 14:22:48 2013 +0200 andre@0: +++ b/lib/pk11wrap/pk11akey.c Mon Apr 22 14:41:49 2013 -0700 andre@0: @@ -136,20 +136,6 @@ andre@0: PK11_SETATTRS(attrs, CKA_VALUE, pubKey->u.dsa.publicValue.data, andre@0: pubKey->u.dsa.publicValue.len); attrs++; andre@0: break; andre@0: - case fortezzaKey: andre@0: - keyType = CKK_DSA; andre@0: - PK11_SETATTRS(attrs, CKA_VERIFY, &cktrue, sizeof(CK_BBOOL));attrs++; andre@0: - signedattr = attrs; andre@0: - PK11_SETATTRS(attrs, CKA_PRIME,pubKey->u.fortezza.params.prime.data, andre@0: - pubKey->u.fortezza.params.prime.len); attrs++; andre@0: - PK11_SETATTRS(attrs,CKA_SUBPRIME, andre@0: - pubKey->u.fortezza.params.subPrime.data, andre@0: - pubKey->u.fortezza.params.subPrime.len);attrs++; andre@0: - PK11_SETATTRS(attrs, CKA_BASE, pubKey->u.fortezza.params.base.data, andre@0: - pubKey->u.fortezza.params.base.len); attrs++; andre@0: - PK11_SETATTRS(attrs, CKA_VALUE, pubKey->u.fortezza.DSSKey.data, andre@0: - pubKey->u.fortezza.DSSKey.len); attrs++; andre@0: - break; andre@0: case dhKey: andre@0: keyType = CKK_DH; andre@0: PK11_SETATTRS(attrs, CKA_DERIVE, &cktrue, sizeof(CK_BBOOL));attrs++; andre@0: @@ -210,6 +196,10 @@ andre@0: SECITEM_FreeItem(pubValue,PR_TRUE); andre@0: } andre@0: if ( rv != SECSuccess) { andre@0: + /* CKR_ATTRIBUTE_VALUE_INVALID is mapped to SEC_ERROR_BAD_DATA */ andre@0: + if (PORT_GetError() == SEC_ERROR_BAD_DATA) { andre@0: + PORT_SetError( SEC_ERROR_BAD_KEY ); andre@0: + } andre@0: return CK_INVALID_HANDLE; andre@0: } andre@0: }