Skip to content

Commit ba6e078

Browse files
hamaritucJakuje
authored andcommitted
pkcs15-prkey.c: correctly check for presence of ECC parameters
closes OpenSC#3031
1 parent 748bae4 commit ba6e078

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libopensc/pkcs15-prkey.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ int sc_pkcs15_decode_prkdf_entry(struct sc_pkcs15_card *p15card,
240240
else if (asn1_prkey[1].flags & SC_ASN1_PRESENT) {
241241
obj->type = SC_PKCS15_TYPE_PRKEY_EC;
242242
#ifdef ENABLE_OPENSSL
243-
if (!info.field_length && ec_domain_len) {
243+
if (!(asn1_ecckey_attr[1].flags & SC_ASN1_PRESENT) && (asn1_ecckey_attr[3].flags & SC_ASN1_PRESENT)) {
244244
const unsigned char *p = ec_domain;
245245
ASN1_OBJECT *object = d2i_ASN1_OBJECT(NULL, &p, ec_domain_len);
246246
int nid;

0 commit comments

Comments
 (0)