diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libssl/t1_enc.c | 57 |
1 files changed, 1 insertions, 56 deletions
diff --git a/src/lib/libssl/t1_enc.c b/src/lib/libssl/t1_enc.c index 2a38d8de6a..33158e160e 100644 --- a/src/lib/libssl/t1_enc.c +++ b/src/lib/libssl/t1_enc.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: t1_enc.c,v 1.115 2018/10/24 18:04:50 jsing Exp $ */ | 1 | /* $OpenBSD: t1_enc.c,v 1.116 2018/11/08 22:28:52 jsing Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -157,61 +157,6 @@ tls1_cleanup_key_block(SSL *s) | |||
| 157 | S3I(s)->hs.key_block_len = 0; | 157 | S3I(s)->hs.key_block_len = 0; |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | int | ||
| 161 | tls1_init_finished_mac(SSL *s) | ||
| 162 | { | ||
| 163 | BIO_free(S3I(s)->handshake_buffer); | ||
| 164 | |||
| 165 | S3I(s)->handshake_buffer = BIO_new(BIO_s_mem()); | ||
| 166 | if (S3I(s)->handshake_buffer == NULL) | ||
| 167 | return (0); | ||
| 168 | |||
| 169 | (void)BIO_set_close(S3I(s)->handshake_buffer, BIO_CLOSE); | ||
| 170 | |||
| 171 | return (1); | ||
| 172 | } | ||
| 173 | |||
| 174 | int | ||
| 175 | tls1_finish_mac(SSL *s, const unsigned char *buf, int len) | ||
| 176 | { | ||
| 177 | if (len < 0) | ||
| 178 | return 0; | ||
| 179 | |||
| 180 | if (!tls1_handshake_hash_update(s, buf, len)) | ||
| 181 | return 0; | ||
| 182 | |||
| 183 | if (S3I(s)->handshake_buffer && | ||
| 184 | !(s->s3->flags & TLS1_FLAGS_KEEP_HANDSHAKE)) { | ||
| 185 | BIO_write(S3I(s)->handshake_buffer, (void *)buf, len); | ||
| 186 | return 1; | ||
| 187 | } | ||
| 188 | |||
| 189 | return 1; | ||
| 190 | } | ||
| 191 | |||
| 192 | int | ||
| 193 | tls1_digest_cached_records(SSL *s) | ||
| 194 | { | ||
| 195 | long hdatalen; | ||
| 196 | void *hdata; | ||
| 197 | |||
| 198 | hdatalen = BIO_get_mem_data(S3I(s)->handshake_buffer, &hdata); | ||
| 199 | if (hdatalen <= 0) { | ||
| 200 | SSLerror(s, SSL_R_BAD_HANDSHAKE_LENGTH); | ||
| 201 | goto err; | ||
| 202 | } | ||
| 203 | |||
| 204 | if (!(s->s3->flags & TLS1_FLAGS_KEEP_HANDSHAKE)) { | ||
| 205 | BIO_free(S3I(s)->handshake_buffer); | ||
| 206 | S3I(s)->handshake_buffer = NULL; | ||
| 207 | } | ||
| 208 | |||
| 209 | return 1; | ||
| 210 | |||
| 211 | err: | ||
| 212 | return 0; | ||
| 213 | } | ||
| 214 | |||
| 215 | void | 160 | void |
| 216 | tls1_record_sequence_increment(unsigned char *seq) | 161 | tls1_record_sequence_increment(unsigned char *seq) |
| 217 | { | 162 | { |
