projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adapt the rest of the source to the opaque HMAC_CTX
[openssl.git]
/
ssl
/
statem
/
statem_srvr.c
diff --git
a/ssl/statem/statem_srvr.c
b/ssl/statem/statem_srvr.c
index 687191d23dbab63c673b1460d3e64cda03639978..f1d1796d1e01a24bedce673907bc1df2cd18a368 100644
(file)
--- a/
ssl/statem/statem_srvr.c
+++ b/
ssl/statem/statem_srvr.c
@@
-3160,7
+3160,7
@@
int tls_construct_new_session_ticket(SSL *s)
{
unsigned char *senc = NULL;
EVP_CIPHER_CTX ctx;
{
unsigned char *senc = NULL;
EVP_CIPHER_CTX ctx;
- HMAC_CTX
hctx = HMAC_CTX_EMPTY
;
+ HMAC_CTX
*hctx = NULL
;
unsigned char *p, *macstart;
const unsigned char *const_p;
int len, slen_full, slen;
unsigned char *p, *macstart;
const unsigned char *const_p;
int len, slen_full, slen;
@@
-3187,7
+3187,7
@@
int tls_construct_new_session_ticket(SSL *s)
}
EVP_CIPHER_CTX_init(&ctx);
}
EVP_CIPHER_CTX_init(&ctx);
-
HMAC_CTX_init(&hctx
);
+
hctx = HMAC_CTX_new(
);
p = senc;
if (!i2d_SSL_SESSION(s->session, &p))
p = senc;
if (!i2d_SSL_SESSION(s->session, &p))
@@
-3233,8
+3233,7
@@
int tls_construct_new_session_ticket(SSL *s)
* all the work otherwise use generated values from parent ctx.
*/
if (tctx->tlsext_ticket_key_cb) {
* all the work otherwise use generated values from parent ctx.
*/
if (tctx->tlsext_ticket_key_cb) {
- if (tctx->tlsext_ticket_key_cb(s, key_name, iv, &ctx,
- &hctx, 1) < 0)
+ if (tctx->tlsext_ticket_key_cb(s, key_name, iv, &ctx, hctx, 1) < 0)
goto err;
} else {
if (RAND_bytes(iv, 16) <= 0)
goto err;
} else {
if (RAND_bytes(iv, 16) <= 0)
@@
-3242,7
+3241,7
@@
int tls_construct_new_session_ticket(SSL *s)
if (!EVP_EncryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL,
tctx->tlsext_tick_aes_key, iv))
goto err;
if (!EVP_EncryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL,
tctx->tlsext_tick_aes_key, iv))
goto err;
- if (!HMAC_Init_ex(
&
hctx, tctx->tlsext_tick_hmac_key, 16,
+ if (!HMAC_Init_ex(hctx, tctx->tlsext_tick_hmac_key, 16,
EVP_sha256(), NULL))
goto err;
memcpy(key_name, tctx->tlsext_tick_key_name, 16);
EVP_sha256(), NULL))
goto err;
memcpy(key_name, tctx->tlsext_tick_key_name, 16);
@@
-3272,13
+3271,13
@@
int tls_construct_new_session_ticket(SSL *s)
goto err;
p += len;
goto err;
p += len;
- if (!HMAC_Update(
&
hctx, macstart, p - macstart))
+ if (!HMAC_Update(hctx, macstart, p - macstart))
goto err;
goto err;
- if (!HMAC_Final(
&
hctx, p, &hlen))
+ if (!HMAC_Final(hctx, p, &hlen))
goto err;
EVP_CIPHER_CTX_cleanup(&ctx);
goto err;
EVP_CIPHER_CTX_cleanup(&ctx);
- HMAC_CTX_
cleanup(&
hctx);
+ HMAC_CTX_
free(
hctx);
p += hlen;
/* Now write out lengths: p points to end of data written */
p += hlen;
/* Now write out lengths: p points to end of data written */
@@
-3295,7
+3294,7
@@
int tls_construct_new_session_ticket(SSL *s)
err:
OPENSSL_free(senc);
EVP_CIPHER_CTX_cleanup(&ctx);
err:
OPENSSL_free(senc);
EVP_CIPHER_CTX_cleanup(&ctx);
- HMAC_CTX_
cleanup(&
hctx);
+ HMAC_CTX_
free(
hctx);
ossl_statem_set_error(s);
return 0;
}
ossl_statem_set_error(s);
return 0;
}