Skip to content

Commit

Permalink
Fix for incorrect declaration of the SSL3_STATE.write_mac_secret fiel…
Browse files Browse the repository at this point in the history
…d in IdSSLOpenSSLHeaders.pas. It was causing subsequent fields to be offset by 1 byte.
  • Loading branch information
RemyLebeau authored and RemyLebeau committed Dec 4, 2018
1 parent d83cae8 commit 5001bca
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions Lib/Protocols/IdSSLOpenSSLHeaders.pas
Original file line number Diff line number Diff line change
Expand Up @@ -16169,15 +16169,15 @@ SSL3_STATE = record
read_mac_secret : array [0..EVP_MAX_MD_SIZE -1] of TIdAnsiChar;
write_sequence : array [0..7] of TIdAnsiChar;
write_mac_secret_size : TIdC_INT;
write_mac_secret : array [0..EVP_MAX_MD_SIZE] of TIdAnsiChar;
write_mac_secret : array [0..EVP_MAX_MD_SIZE - 1] of TIdAnsiChar;
server_random : array [0..SSL3_RANDOM_SIZE - 1] of TIdAnsiChar;
client_random : array [0..SSL3_RANDOM_SIZE -1] of TIdAnsiChar;
// flags for countermeasure against known-IV weakness
need_empty_fragments : TIdC_INT;
empty_fragment_done : TIdC_INT;

//* The value of 'extra' when the buffers were initialized */
init_extra : TIdC_INT;
//* The value of 'extra' when the buffers were initialized */
init_extra : TIdC_INT;
rbuf : PSSL3_BUFFER; //* read IO goes into here */
wbuf : PSSL3_BUFFER; //* write IO goes into here */
rrec : PSSL3_RECORD; //* each decoded record goes in here */
Expand All @@ -16196,10 +16196,10 @@ SSL3_STATE = record
wpend_buf : PByte;
// used during startup, digest all incoming/outgoing packets */
handshake_buffer : PBIO;
//* When set of handshake digests is determined, buffer is hashed
// * and freed and MD_CTX-es for all required digests are stored in
// * this array */
handshake_dgst : PPEVP_MD_CTX;
//* When set of handshake digests is determined, buffer is hashed
// * and freed and MD_CTX-es for all required digests are stored in
// * this array */
handshake_dgst : PPEVP_MD_CTX;

finish_dgst2 : PEVP_MD_CTX;
// this is set whenerver we see a change_cipher_spec message
Expand All @@ -16209,22 +16209,22 @@ SSL3_STATE = record
fatal_alert : TIdC_INT;
// we allow one fatal and one warning alert to be outstanding,
// send close alert via the warning alert */
alert_dispatch : TIdC_INT;
send_alert : array [0..1] of TIdAnsiChar;
alert_dispatch : TIdC_INT;
send_alert : array [0..1] of TIdAnsiChar;
// This flag is set when we should renegotiate ASAP, basically when
// there is no more data in the read or write buffers
renegotiate : TIdC_INT;
total_renegotiations : TIdC_INT;
num_renegotiations : TIdC_INT;
in_read_app_data : TIdC_INT;

//* Opaque PRF input as used for the current handshake.
// * These fields are used only if TLSEXT_TYPE_opaque_prf_input is defined
// * (otherwise, they are merely present to improve binary compatibility) */
client_opaque_prf_input : Pointer;
client_opaque_prf_input_len : size_t;
server_opaque_prf_input : Pointer;
server_opaque_prf_input_len : size_t;
//* Opaque PRF input as used for the current handshake.
// * These fields are used only if TLSEXT_TYPE_opaque_prf_input is defined
// * (otherwise, they are merely present to improve binary compatibility) */
client_opaque_prf_input : Pointer;
client_opaque_prf_input_len : size_t;
server_opaque_prf_input : Pointer;
server_opaque_prf_input_len : size_t;
// actually only needs to be 16+20
tmp_cert_verify_md: array [0..(EVP_MAX_MD_SIZE*2)-1] of TIdAnsiChar;
// actually only need to be 16+20 for SSLv3 and 12 for TLS
Expand Down Expand Up @@ -16265,14 +16265,14 @@ SSL3_STATE = record
tmp_cert_request : TIdC_INT;

//* Connection binding to prevent renegotiation attacks */
previous_client_finished : array [0..EVP_MAX_MD_SIZE - 1] of TIdAnsiChar;
previous_client_finished_len : Byte;
previous_server_finished : array [0..EVP_MAX_MD_SIZE - 1] of TIdAnsiChar;
previous_server_finished_len : Byte;
send_connection_binding : TIdC_INT; //* TODOEKR */
previous_client_finished : array [0..EVP_MAX_MD_SIZE - 1] of TIdAnsiChar;
previous_client_finished_len : Byte;
previous_server_finished : array [0..EVP_MAX_MD_SIZE - 1] of TIdAnsiChar;
previous_server_finished_len : Byte;
send_connection_binding : TIdC_INT; //* TODOEKR */
{$ifndef OPENSSL_NO_NEXTPROTONEG}
//* Set if we saw the Next Protocol Negotiation extension from our peer. */
next_proto_neg_seen : TIdC_INT;
//* Set if we saw the Next Protocol Negotiation extension from our peer. */
next_proto_neg_seen : TIdC_INT;
{$endif}
end;
{$ENDIF}
Expand Down

0 comments on commit 5001bca

Please sign in to comment.