Fix for #2283 C_Sign fails ECDSA when card can do HASH on card

Do not truncate ECDSA input to size of key if card or driver will do HASH.

 On branch Fix_for_2283_ECDSA
 Changes to be committed:
	modified:   src/libopensc/pkcs15-sec.c
This commit is contained in:
Doug Engert 2021-04-01 10:51:27 -05:00 committed by Frank Morgner
parent a21bcf4b41
commit 19611682bd
1 changed files with 1 additions and 1 deletions

View File

@ -737,7 +737,7 @@ int sc_pkcs15_compute_signature(struct sc_pkcs15_card *p15card,
* But if card is going to do the hash, pass in all the data
*/
else if (senv.algorithm == SC_ALGORITHM_EC &&
(senv.flags & SC_ALGORITHM_ECDSA_HASHES) == 0) {
(senv.algorithm_flags & SC_ALGORITHM_ECDSA_HASHES) == 0) {
inlen = MIN(inlen, (prkey->field_length+7)/8);
}