From 016264b6cb442d27c436fb1b061cae4b9365a844 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Mon, 22 May 2023 18:40:35 +0200 Subject: [PATCH] pk: fix a return value and a typo in comment Signed-off-by: Valerio Setti --- include/mbedtls/pk.h | 2 +- library/pkparse.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/mbedtls/pk.h b/include/mbedtls/pk.h index 3a5543a3c1..ffd1b73b23 100644 --- a/include/mbedtls/pk.h +++ b/include/mbedtls/pk.h @@ -282,7 +282,7 @@ typedef struct mbedtls_pk_context { * - the following fields are used for all public key operations: signature * verify, key pair check and key write. * Of course, when MBEDTLS_PK_USE_PSA_EC_DATA is not enabled, the legacy - * ecp_keypair structure is used for storing the public key and perform + * ecp_keypair structure is used for storing the public key and performing * all the operations. * * Note: This new public key storing solution only works for EC keys, not diff --git a/library/pkparse.c b/library/pkparse.c index d47b099493..9bc88015af 100644 --- a/library/pkparse.c +++ b/library/pkparse.c @@ -722,7 +722,7 @@ static int pk_get_ecpubkey(unsigned char **p, const unsigned char *end, } else { /* Uncompressed format */ if ((end - *p) > MBEDTLS_PK_MAX_EC_PUBKEY_RAW_LEN) { - return MBEDTLS_ERR_PK_BAD_INPUT_DATA; + return MBEDTLS_ERR_PK_BUFFER_TOO_SMALL; } memcpy(pk->pub_raw, *p, (end - *p)); pk->pub_raw_len = end - *p;