cleanse psk_identity on error
Reviewed-by: Matt Caswell <matt@openssl.org>
This commit is contained in:
parent
a784665e52
commit
3df16cc2e2
@ -2391,8 +2391,10 @@ int ssl3_send_client_key_exchange(SSL *s)
|
|||||||
s->s3->tmp.psk = BUF_memdup(psk, psklen);
|
s->s3->tmp.psk = BUF_memdup(psk, psklen);
|
||||||
OPENSSL_cleanse(psk, psklen);
|
OPENSSL_cleanse(psk, psklen);
|
||||||
|
|
||||||
if (s->s3->tmp.psk == NULL)
|
if (s->s3->tmp.psk == NULL) {
|
||||||
|
OPENSSL_cleanse(identity, sizeof(identity));
|
||||||
goto memerr;
|
goto memerr;
|
||||||
|
}
|
||||||
|
|
||||||
s->s3->tmp.psklen = psklen;
|
s->s3->tmp.psklen = psklen;
|
||||||
|
|
||||||
@ -2404,8 +2406,10 @@ int ssl3_send_client_key_exchange(SSL *s)
|
|||||||
}
|
}
|
||||||
OPENSSL_free(s->session->psk_identity);
|
OPENSSL_free(s->session->psk_identity);
|
||||||
s->session->psk_identity = BUF_strdup(identity);
|
s->session->psk_identity = BUF_strdup(identity);
|
||||||
if (s->session->psk_identity == NULL)
|
if (s->session->psk_identity == NULL) {
|
||||||
|
OPENSSL_cleanse(identity, sizeof(identity));
|
||||||
goto memerr;
|
goto memerr;
|
||||||
|
}
|
||||||
|
|
||||||
s2n(identitylen, p);
|
s2n(identitylen, p);
|
||||||
memcpy(p, identity, identitylen);
|
memcpy(p, identity, identitylen);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user