From fe9edc9d39c96c965efc4fde12ddf7fa8a852025 Mon Sep 17 00:00:00 2001 From: Todd Short Date: Mon, 15 Jul 2019 09:55:13 -0400 Subject: [PATCH] Fix SSL_CTX_set_session_id_context() docs Also, use define rather than sizeof Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/9377) --- doc/man3/SSL_CTX_set_session_id_context.pod | 4 ++-- ssl/ssl_lib.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/man3/SSL_CTX_set_session_id_context.pod b/doc/man3/SSL_CTX_set_session_id_context.pod index a77bf8e6d0..ccc10a7e14 100644 --- a/doc/man3/SSL_CTX_set_session_id_context.pod +++ b/doc/man3/SSL_CTX_set_session_id_context.pod @@ -42,7 +42,7 @@ OpenSSL clients will check the session id context returned by the server when reusing a session. The maximum length of the B is limited to -B. +B. =head1 WARNINGS @@ -67,7 +67,7 @@ return the following values: =item Z<>0 The length B of the session id context B exceeded -the maximum allowed length of B. The error +the maximum allowed length of B. The error is logged to the error stack. =item Z<>1 diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 211a828981..c88368ed61 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -877,7 +877,7 @@ int SSL_up_ref(SSL *s) int SSL_CTX_set_session_id_context(SSL_CTX *ctx, const unsigned char *sid_ctx, unsigned int sid_ctx_len) { - if (sid_ctx_len > sizeof(ctx->sid_ctx)) { + if (sid_ctx_len > SSL_MAX_SID_CTX_LENGTH) { SSLerr(SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG); return 0;