From 2698bbfec60bf048bc7362307658143b5ad657d5 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Tue, 18 Apr 2017 17:53:29 +0100 Subject: [PATCH] Add an SSL_ prefix to SERVERINFOV2 and SERVERINFOV1 Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/3298) --- include/openssl/ssl.h | 4 ++-- ssl/ssl_rsa.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index 0fbd7425d4..764ecea31a 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -1453,8 +1453,8 @@ __owur int SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len); /* serverinfo file format versions */ -# define SERVERINFOV1 1 -# define SERVERINFOV2 2 +# define SSL_SERVERINFOV1 1 +# define SSL_SERVERINFOV2 2 /* Set serverinfo data for the current active cert. */ __owur int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo, diff --git a/ssl/ssl_rsa.c b/ssl/ssl_rsa.c index a6824b0f6c..bf9678d118 100644 --- a/ssl/ssl_rsa.c +++ b/ssl/ssl_rsa.c @@ -798,7 +798,7 @@ static int serverinfo_process_buffer(unsigned int version, if (serverinfo == NULL || serverinfo_length == 0) return 0; - if (version != SERVERINFOV1 && version != SERVERINFOV2) + if (version != SSL_SERVERINFOV1 && version != SSL_SERVERINFOV2) return 0; if (!PACKET_buf_init(&pkt, serverinfo, serverinfo_length)) @@ -817,7 +817,7 @@ static int serverinfo_process_buffer(unsigned int version, if (ctx == NULL) continue; - if (version == SERVERINFOV1) { + if (version == SSL_SERVERINFOV1) { if (!SSL_CTX_add_server_custom_ext(ctx, ext_type, serverinfo_srv_add_cb, NULL, NULL, @@ -881,7 +881,7 @@ int SSL_CTX_use_serverinfo_ex(SSL_CTX *ctx, unsigned int version, int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo, size_t serverinfo_length) { - return SSL_CTX_use_serverinfo_ex(ctx, SERVERINFOV1, serverinfo, + return SSL_CTX_use_serverinfo_ex(ctx, SSL_SERVERINFOV1, serverinfo, serverinfo_length); } @@ -935,7 +935,7 @@ int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file) goto end; } if (strncmp(name, namePrefix1, strlen(namePrefix1)) == 0) { - version = SERVERINFOV1; + version = SSL_SERVERINFOV1; } else { if (strlen(name) < strlen(namePrefix2)) { SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO_FILE, @@ -947,12 +947,12 @@ int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file) SSL_R_PEM_NAME_BAD_PREFIX); goto end; } - version = SERVERINFOV2; + version = SSL_SERVERINFOV2; } /* * Check that the decoded PEM data is plausible (valid length field) */ - if (version == SERVERINFOV1) { + if (version == SSL_SERVERINFOV1) { /* 4 byte header: 2 bytes type, 2 bytes len */ if (extension_length < 4 || (extension[2] << 8) + extension[3] -- 2.25.1