diff options
author | Richard Levitte <levitte@openssl.org> | 2021-06-22 18:11:03 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2021-06-23 23:00:36 +0200 |
commit | 21dfdbef4965d95d65bfc942aafafd342cb61e4c (patch) | |
tree | 0109e97fe55d84ca320052636c173d847b2fa134 /apps/lib | |
parent | 006de7670a12dff617e86a55b6db7c6e3b1f8fef (diff) |
Adapt other parts of the source to the changed EVP_Q_digest() and EVP_Q_mac()
Fixes #15839
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15861)
Diffstat (limited to 'apps/lib')
-rw-r--r-- | apps/lib/s_cb.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/apps/lib/s_cb.c b/apps/lib/s_cb.c index ef431c98ea..245bae6249 100644 --- a/apps/lib/s_cb.c +++ b/apps/lib/s_cb.c @@ -740,8 +740,8 @@ void tlsext_cb(SSL *s, int client_server, int type, } #ifndef OPENSSL_NO_SOCK -int generate_cookie_callback(SSL *ssl, unsigned char *cookie, - unsigned int *cookie_len) +int generate_stateless_cookie_callback(SSL *ssl, unsigned char *cookie, + size_t *cookie_len) { unsigned char *buffer = NULL; size_t length = 0; @@ -800,16 +800,16 @@ end: return res; } -int verify_cookie_callback(SSL *ssl, const unsigned char *cookie, - unsigned int cookie_len) +int verify_stateless_cookie_callback(SSL *ssl, const unsigned char *cookie, + size_t cookie_len) { unsigned char result[EVP_MAX_MD_SIZE]; - unsigned int resultlength; + size_t resultlength; /* Note: we check cookie_initialized because if it's not, * it cannot be valid */ if (cookie_initialized - && generate_cookie_callback(ssl, result, &resultlength) + && generate_stateless_cookie_callback(ssl, result, &resultlength) && cookie_len == resultlength && memcmp(result, cookie, resultlength) == 0) return 1; @@ -817,20 +817,20 @@ int verify_cookie_callback(SSL *ssl, const unsigned char *cookie, return 0; } -int generate_stateless_cookie_callback(SSL *ssl, unsigned char *cookie, - size_t *cookie_len) +int generate_cookie_callback(SSL *ssl, unsigned char *cookie, + unsigned int *cookie_len) { - unsigned int temp = 0; + size_t temp = 0; + int res = generate_stateless_cookie_callback(ssl, cookie, &temp); - int res = generate_cookie_callback(ssl, cookie, &temp); - *cookie_len = temp; + *cookie_len = (unsigned int)temp; return res; } -int verify_stateless_cookie_callback(SSL *ssl, const unsigned char *cookie, - size_t cookie_len) +int verify_cookie_callback(SSL *ssl, const unsigned char *cookie, + unsigned int cookie_len) { - return verify_cookie_callback(ssl, cookie, cookie_len); + return verify_stateless_cookie_callback(ssl, cookie, cookie_len); } #endif |