Skip to content

Comments

Always ensure that init_msg is initialised for a CCS#1847

Closed
mattcaswell wants to merge 1 commit intoopenssl:masterfrom
mattcaswell:init-init_msg-ccs
Closed

Always ensure that init_msg is initialised for a CCS#1847
mattcaswell wants to merge 1 commit intoopenssl:masterfrom
mattcaswell:init-init_msg-ccs

Conversation

@mattcaswell
Copy link
Member

Description of change

We don't initialise init_msg for a CCS, but we read it later in grow_init_buf(). If CCS is the first thing received in a flight, then it will use the init_msg from the last flight we received. If the init_buf has been grown in the meantime then it will point to some arbitrary other memory location. This is likely to result in grow_init_buf() attempting to grow to some excessively large amount which is likely to fail. In practice this should never happen because the only time we receive a CCS as the first thing in a flight is in an abbreviated handshake. None of the preceding messages from the server flight would be large enough to trigger this. However this bug is causing a problem for the TLS1.3 work and should be fixed anyway.

We read it later in grow_init_buf(). If CCS is the first thing received in
a flight, then it will use the init_msg from the last flight we received. If
the init_buf has been grown in the meantime then it will point to some
arbitrary other memory location. This is likely to result in grow_init_buf()
attempting to grow to some excessively large amount which is likely to
fail. In practice this should never happen because the only time we receive
a CCS as the first thing in a flight is in an abbreviated handshake. None
of the preceding messages from the server flight would be large enough to
trigger this.
@mattcaswell
Copy link
Member Author

Merged. Thanks.

@mattcaswell mattcaswell closed this Nov 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch: master Applies to master branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants