summaryrefslogtreecommitdiffstats
path: root/ssl/ssl_conf.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2021-05-11 10:51:13 -0400
committerMatt Caswell <matt@openssl.org>2021-05-14 09:59:38 +0100
commit56bd17830f2d5855b533d923d4e0649d3ed61d11 (patch)
treece86ed934d883339d8f53d9f5933cc064d95c46e /ssl/ssl_conf.c
parent8a0f65f06b0b0fa0411175bcd764c818d9c52469 (diff)
Convert SSL_{CTX}_[gs]et_options to 64
Less tersely: converted SSL_get_options, SSL_set_options, SSL_CTX_get_options and SSL_CTX_get_options to take and return uint64_t since we were running out of 32 bits. Fixes: 15145 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15230)
Diffstat (limited to 'ssl/ssl_conf.c')
-rw-r--r--ssl/ssl_conf.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/ssl/ssl_conf.c b/ssl/ssl_conf.c
index 1f288b5e06..832026c4ce 100644
--- a/ssl/ssl_conf.c
+++ b/ssl/ssl_conf.c
@@ -24,12 +24,12 @@ typedef struct {
const char *name;
int namelen;
unsigned int name_flags;
- unsigned long option_value;
+ uint64_t option_value;
} ssl_flag_tbl;
/* Switch table: use for single command line switches like no_tls2 */
typedef struct {
- unsigned long option_value;
+ uint64_t option_value;
unsigned int name_flags;
} ssl_switch_tbl;
@@ -84,7 +84,7 @@ struct ssl_conf_ctx_st {
SSL_CTX *ctx;
SSL *ssl;
/* Pointer to SSL or SSL_CTX options field or NULL if none */
- uint32_t *poptions;
+ uint64_t *poptions;
/* Certificate filenames for each type */
char *cert_filename[SSL_PKEY_NUM];
/* Pointer to SSL or SSL_CTX cert_flags or NULL if none */
@@ -107,6 +107,7 @@ static void ssl_set_option(SSL_CONF_CTX *cctx, unsigned int name_flags,
unsigned long option_value, int onoff)
{
uint32_t *pflags;
+
if (cctx->poptions == NULL)
return;
if (name_flags & SSL_TFLAG_INV)
@@ -120,10 +121,13 @@ static void ssl_set_option(SSL_CONF_CTX *cctx, unsigned int name_flags,
case SSL_TFLAG_VFY:
pflags = cctx->pvfy_flags;
break;
-
+
case SSL_TFLAG_OPTION:
- pflags = cctx->poptions;
- break;
+ if (onoff)
+ *cctx->poptions |= option_value;
+ else
+ *cctx->poptions &= ~option_value;
+ return;
default:
return;