MyEID - T0 protocol fail for derive operation

apdu.le  must be set minimally to shared key length (pubkey_len / 2),
otherwise sc_get_response() does not read derived shared key from card.
This commit is contained in:
Peter Popovec 2017-07-03 13:19:42 +02:00 committed by Frank Morgner
parent 4ea2828246
commit a197ba1a99
1 changed files with 1 additions and 1 deletions

View File

@ -1005,7 +1005,7 @@ int myeid_ecdh_derive(struct sc_card *card, const u8* pubkey, size_t pubkey_len,
memcpy(&sbuf[4 + ext_len_bytes], pubkey, pubkey_len);
apdu.lc = pubkey_len + 4 + ext_len_bytes;
apdu.le = 0;
apdu.le = pubkey_len / 2;
apdu.datalen = apdu.lc;
apdu.data = sbuf;