Skip to content

Commit

Permalink
fixup! Fix sctp compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
slontis committed Oct 13, 2022
1 parent 8db831c commit c4fcadb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
16 changes: 6 additions & 10 deletions ssl/record/rec_layer_d1.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,12 @@ int dtls_buffer_record(SSL_CONNECTION *s, TLS_RECORD *rec)
item->data = rdata;

#ifndef OPENSSL_NO_SCTP
{
SSL *ssl = SSL_CONNECTION_GET_SSL(s);

/* Store bio_dgram_sctp_rcvinfo struct */
if (BIO_dgram_is_sctp(SSL_get_rbio(ssl)) &&
(SSL_get_state(ssl) == TLS_ST_SR_FINISHED
|| SSL_get_state(ssl) == TLS_ST_CR_FINISHED)) {
BIO_ctrl(SSL_get_rbio(ssl), BIO_CTRL_DGRAM_SCTP_GET_RCVINFO,
sizeof(rdata->recordinfo), &rdata->recordinfo);
}
/* Store bio_dgram_sctp_rcvinfo struct */
if (BIO_dgram_is_sctp(s->rbio) &&
(ossl_statem_get_state(s) == TLS_ST_SR_FINISHED
|| ossl_statem_get_state(s) == TLS_ST_CR_FINISHED)) {
BIO_ctrl(s->rbio, BIO_CTRL_DGRAM_SCTP_GET_RCVINFO,
sizeof(rdata->recordinfo), &rdata->recordinfo);
}
#endif

Expand Down
5 changes: 5 additions & 0 deletions ssl/statem/statem.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ int SSL_in_before(const SSL *s)
&& (sc->statem.state == MSG_FLOW_UNINITED);
}

OSSL_HANDSHAKE_STATE ossl_statem_get_state(SSL_CONNECTION *s)
{
return s != NULL ? s->statem.hand_state : TLS_ST_BEFORE;
}

/*
* Clear the state machine state and reset back to MSG_FLOW_UNINITED
*/
Expand Down
1 change: 1 addition & 0 deletions ssl/statem/statem.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ typedef struct ossl_statem_st OSSL_STATEM;

__owur int ossl_statem_accept(SSL *s);
__owur int ossl_statem_connect(SSL *s);
OSSL_HANDSHAKE_STATE ossl_statem_get_state(SSL_CONNECTION *s);
void ossl_statem_clear(SSL_CONNECTION *s);
void ossl_statem_set_renegotiate(SSL_CONNECTION *s);
void ossl_statem_send_fatal(SSL_CONNECTION *s, int al);
Expand Down

0 comments on commit c4fcadb

Please sign in to comment.