mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
Postpone freeing of X509 context to the first data exchange after handshake
X509 context contains certificate fingerprint and various names which may be used to verify the certificate. Previously we would free it right after the handshake completion, which prevented the client from actually using any information from X509 context. Postponing this to the first ssl_read/ssl_write call after the handshake, we give the client a chance to verify the certificate. Also added logging to ssl_match_fingerprint function in case fingerprint doesn't match expected value.
This commit is contained in:
@ -119,10 +119,7 @@ int do_clnt_handshake(SSL *ssl, int handshake_type, uint8_t *buf, int hs_len)
|
||||
|
||||
case HS_FINISHED:
|
||||
ret = process_finished(ssl, buf, hs_len);
|
||||
ssl->fingerprint = ssl->x509_ctx->fingerprint;
|
||||
ssl->x509_ctx->fingerprint = 0;
|
||||
disposable_free(ssl); /* free up some memory */
|
||||
increase_bm_data_size(ssl);
|
||||
disposable_free(ssl);
|
||||
/* note: client renegotiation is not allowed after this */
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user