From b2c2980d73d89100364f8dbc447752cca5e2615e Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Sun, 30 Oct 2022 21:10:15 +0100 Subject: [PATCH] Fix secure channel with no payload. Signed-off-by: Pol Henarejos --- src/eac.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/eac.c b/src/eac.c index 322e815..c0565e1 100644 --- a/src/eac.c +++ b/src/eac.c @@ -106,8 +106,10 @@ int sm_unwrap() { } } } - if (!body) - return CCID_WRONG_DATA; + if (!body) { + apdu.nc = 0; + return CCID_OK; + } if (is87 && *body++ != 0x1) { return CCID_WRONG_PADDING; }