From ec7ab1a4ed45669e215ad4ffe058d127b38c9207 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 17 Apr 2019 16:52:58 +0200 Subject: [PATCH] fix: https://github.com/RfidResearchGroup/proxmark3/issues/166 --- client/emv/crypto_polarssl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/emv/crypto_polarssl.c b/client/emv/crypto_polarssl.c index bee81a797..13f093aa4 100644 --- a/client/emv/crypto_polarssl.c +++ b/client/emv/crypto_polarssl.c @@ -261,7 +261,7 @@ static unsigned char *crypto_pk_polarssl_get_parameter(const struct crypto_pk *_ result = malloc(*plen); memset(result, 0x00, *plen); res = mbedtls_mpi_write_binary(&cp->ctx.N, result, *plen); - if (res == 0) { + if (res < 0) { printf("Error write_binary."); result = 0; } @@ -272,7 +272,7 @@ static unsigned char *crypto_pk_polarssl_get_parameter(const struct crypto_pk *_ result = malloc(*plen); memset(result, 0x00, *plen); res = mbedtls_mpi_write_binary(&cp->ctx.E, result, *plen); - if (res == 0) { + if (res < 0) { printf("Error write_binary."); result = 0; }