Skip to content

Commit 432808b

Browse files
committed
Remove three bytes from PKCS#11 ECPoint string
The CKA_EC_POINT is defined as 'DER encoded X9.62 octet string', which means it has DER preamble and also compression indicator. So we remove these from the result string, and pass it along, to get valid ECPoint value for DNS use.
1 parent ba4d623 commit 432808b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pdns/pkcs11signers.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ class Pkcs11Token {
353353
d_ecdsa_params = attr[0].str();
354354
if (d_ecdsa_params == "\x06\x08\x2a\x86\x48\xce\x3d\x03\x01\x07") d_bits = 256;
355355
if (d_ecdsa_params == "\x06\x05\x2b\x81\x04\x00\x22") d_bits = 384;
356-
d_ec_point = attr[1].str();
356+
d_ec_point = attr[1].str().substr(3);
357357
} else {
358358
throw PDNSException("Cannot load attributes for PCKS#11 public key " + d_label);
359359
}

0 commit comments

Comments
 (0)