[pkg-opensc-commit] [opensc] 08/23: MyEID - T0 protocol fail for derive operation

Eric Dorland eric at moszumanska.debian.org
Sun Jul 23 18:23:08 UTC 2017


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository opensc.

commit a197ba1a99271525424b53e507e0afe5eb41473d
Author: Peter Popovec <popovec at fei.tuke.sk>
Date:   Mon Jul 3 13:19:42 2017 +0200

    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.
---
 src/libopensc/card-myeid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libopensc/card-myeid.c b/src/libopensc/card-myeid.c
index 80c2821..1b053a0 100644
--- a/src/libopensc/card-myeid.c
+++ b/src/libopensc/card-myeid.c
@@ -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;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/opensc.git



More information about the pkg-opensc-commit mailing list