From 746def5adeb3aa1a41d144dff1c77e57eb434937 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Tue, 10 Jan 2023 11:46:34 +0100 Subject: [PATCH] x509: renaming of buffer variables in new serial setting function Signed-off-by: Valerio Setti --- include/mbedtls/x509_crt.h | 11 +++++------ library/x509write_crt.c | 9 ++++----- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/include/mbedtls/x509_crt.h b/include/mbedtls/x509_crt.h index f88e8cc2c..56cc56be0 100644 --- a/include/mbedtls/x509_crt.h +++ b/include/mbedtls/x509_crt.h @@ -1012,18 +1012,17 @@ int MBEDTLS_DEPRECATED mbedtls_x509write_crt_set_serial( /** * \brief Set the serial number for a Certificate. * - * \param ctx CRT context to use - * \param serial_buff A raw array of bytes containing the serial number - * in big endian format - * \param serial_buff_len Length of the previous input buffer buffer + * \param ctx CRT context to use + * \param serial A raw array of bytes containing the serial number in big + * endian format + * \param serial_len Length of the previous input buffer buffer * * \return 0 if successful, or * MBEDTLS_ERR_X509_BAD_INPUT_DATA if the provided input buffer * is too big (longer than MBEDTLS_X509_RFC5280_MAX_SERIAL_LEN) */ int mbedtls_x509write_crt_set_serial_new(mbedtls_x509write_cert *ctx, - unsigned char *serial_buff, - size_t serial_buff_len); + unsigned char *serial, size_t serial_len); /** * \brief Set the validity period for a Certificate diff --git a/library/x509write_crt.c b/library/x509write_crt.c index da9ef6c12..5cd1e30d4 100644 --- a/library/x509write_crt.c +++ b/library/x509write_crt.c @@ -131,15 +131,14 @@ int mbedtls_x509write_crt_set_serial(mbedtls_x509write_cert *ctx, #endif // MBEDTLS_BIGNUM_C && !MBEDTLS_DEPRECATED_REMOVED int mbedtls_x509write_crt_set_serial_new(mbedtls_x509write_cert *ctx, - unsigned char *serial_buff, - size_t serial_buff_len) + unsigned char *serial, size_t serial_len) { - if (serial_buff_len > MBEDTLS_X509_RFC5280_MAX_SERIAL_LEN) { + if (serial_len > MBEDTLS_X509_RFC5280_MAX_SERIAL_LEN) { return MBEDTLS_ERR_X509_BAD_INPUT_DATA; } - ctx->serial_len = serial_buff_len; - memcpy(ctx->serial, serial_buff, serial_buff_len); + ctx->serial_len = serial_len; + memcpy(ctx->serial, serial, serial_len); return 0; }