Skip to content

Commit

Permalink
pkcs11-tool: make ECPoint behaviour standards compliant by default
Browse files Browse the repository at this point in the history
Fixes OpenSC#1286. The behaviour of pkcs11-tool will follow the standard -
send DER. If EC_POINT_NO_ASN1_OCTET_STRING is defined then it will
write plain bytes.
  • Loading branch information
aalba6675 committed Mar 19, 2018
1 parent 7ca16a7 commit 326cde2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tools/pkcs11-tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -2632,7 +2632,7 @@ parse_ec_pkey(EVP_PKEY *pkey, int private, struct gostkey_info *gost)
header_len = point-gost->public.value;
memcpy(point, buf, point_len);
gost->public.len = header_len+point_len;
#ifndef EC_POINT_NO_ASN1_OCTET_STRING // workaround for non-compliant cards not expecting DER encoding
#ifdef EC_POINT_NO_ASN1_OCTET_STRING // workaround for non-compliant cards not expecting DER encoding
gost->public.len -= header_len;
gost->public.value += header_len;
#endif
Expand Down

0 comments on commit 326cde2

Please sign in to comment.