[pkg-opensc-commit] [opensc] 18/50: Proposed fix for #723

Eric Dorland eric at moszumanska.debian.org
Sat May 28 03:35:47 UTC 2016


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

eric pushed a commit to branch master
in repository opensc.

commit a3e7ebec4287bd8521a8b239b09ae2e6654d4357
Author: Thomas König <tom at fair-coin.org>
Date:   Tue Mar 29 17:36:01 2016 +0200

    Proposed fix for #723
---
 src/libopensc/card-sc-hsm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/libopensc/card-sc-hsm.c b/src/libopensc/card-sc-hsm.c
index 9448245..b16a0cc 100644
--- a/src/libopensc/card-sc-hsm.c
+++ b/src/libopensc/card-sc-hsm.c
@@ -546,6 +546,11 @@ static int sc_hsm_compute_signature(sc_card_t *card,
 		LOG_FUNC_RETURN(card->ctx, SC_ERROR_OBJECT_NOT_FOUND);
 	}
 
+	// check if datalen exceeds the buffer size
+	if (datalen > SC_MAX_APDU_BUFFER_SIZE) {
+		LOG_FUNC_RETURN(card->ctx, SC_ERROR_INVALID_ARGUMENTS);
+	}
+
 	sc_format_apdu(card, &apdu, SC_APDU_CASE_4, 0x68, priv->env->key_ref[0], priv->algorithm);
 	apdu.cla = 0x80;
 	apdu.resp = rbuf;

-- 
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