From b1db72923e1b9c08bcb19b526ad142f8340fdc2c Mon Sep 17 00:00:00 2001 From: Xiaokang Qian Date: Wed, 6 Dec 2023 02:33:38 +0000 Subject: [PATCH] Rename the generic read functions to ssl_read_file_text Signed-off-by: Xiaokang Qian --- programs/ssl/ssl_client2.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c index 64d2a1e39..d4ca4d824 100644 --- a/programs/ssl/ssl_client2.c +++ b/programs/ssl/ssl_client2.c @@ -720,21 +720,22 @@ exit: #if defined(MBEDTLS_SSL_EARLY_DATA) -#define MBEDTLS_ERR_EARLY_FILE_IO_ERROR -2 +#define MBEDTLS_ERR_FILE_IO_ERROR -2 -int ssl_early_data_read_file(const char *path, unsigned char **buffer, size_t *length) +static int ssl_read_file_text(const char *path, + unsigned char **buffer, size_t *length) { FILE *f; long size; if ((f = fopen(path, "rb")) == NULL) { - return MBEDTLS_ERR_EARLY_FILE_IO_ERROR; + return MBEDTLS_ERR_FILE_IO_ERROR; } fseek(f, 0, SEEK_END); if ((size = ftell(f)) == -1) { fclose(f); - return MBEDTLS_ERR_EARLY_FILE_IO_ERROR; + return MBEDTLS_ERR_FILE_IO_ERROR; } fseek(f, 0, SEEK_SET); @@ -747,7 +748,7 @@ int ssl_early_data_read_file(const char *path, unsigned char **buffer, size_t *l if (fread(*buffer, 1, *length, f) != *length) { fclose(f); - return MBEDTLS_ERR_EARLY_FILE_IO_ERROR; + return MBEDTLS_ERR_FILE_IO_ERROR; } fclose(f);