diff options
Diffstat (limited to 'src/lib/libssl/t1_enc.c')
| -rw-r--r-- | src/lib/libssl/t1_enc.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/lib/libssl/t1_enc.c b/src/lib/libssl/t1_enc.c index 892fc31796..1c96abb378 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.82 2015/09/11 17:54:23 jsing Exp $ */ | 1 | /* $OpenBSD: t1_enc.c,v 1.83 2015/09/11 18:08:21 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 | * |
| @@ -144,7 +144,7 @@ | |||
| 144 | #include <openssl/md5.h> | 144 | #include <openssl/md5.h> |
| 145 | 145 | ||
| 146 | void | 146 | void |
| 147 | ssl3_cleanup_key_block(SSL *s) | 147 | tls1_cleanup_key_block(SSL *s) |
| 148 | { | 148 | { |
| 149 | if (s->s3->tmp.key_block != NULL) { | 149 | if (s->s3->tmp.key_block != NULL) { |
| 150 | explicit_bzero(s->s3->tmp.key_block, | 150 | explicit_bzero(s->s3->tmp.key_block, |
| @@ -156,10 +156,10 @@ ssl3_cleanup_key_block(SSL *s) | |||
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | int | 158 | int |
| 159 | ssl3_init_finished_mac(SSL *s) | 159 | tls1_init_finished_mac(SSL *s) |
| 160 | { | 160 | { |
| 161 | BIO_free(s->s3->handshake_buffer); | 161 | BIO_free(s->s3->handshake_buffer); |
| 162 | ssl3_free_digest_list(s); | 162 | tls1_free_digest_list(s); |
| 163 | 163 | ||
| 164 | s->s3->handshake_buffer = BIO_new(BIO_s_mem()); | 164 | s->s3->handshake_buffer = BIO_new(BIO_s_mem()); |
| 165 | if (s->s3->handshake_buffer == NULL) | 165 | if (s->s3->handshake_buffer == NULL) |
| @@ -171,7 +171,7 @@ ssl3_init_finished_mac(SSL *s) | |||
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | void | 173 | void |
| 174 | ssl3_free_digest_list(SSL *s) | 174 | tls1_free_digest_list(SSL *s) |
| 175 | { | 175 | { |
| 176 | int i; | 176 | int i; |
| 177 | 177 | ||
| @@ -189,7 +189,7 @@ ssl3_free_digest_list(SSL *s) | |||
| 189 | } | 189 | } |
| 190 | 190 | ||
| 191 | void | 191 | void |
| 192 | ssl3_finish_mac(SSL *s, const unsigned char *buf, int len) | 192 | tls1_finish_mac(SSL *s, const unsigned char *buf, int len) |
| 193 | { | 193 | { |
| 194 | if (s->s3->handshake_buffer && | 194 | if (s->s3->handshake_buffer && |
| 195 | !(s->s3->flags & TLS1_FLAGS_KEEP_HANDSHAKE)) { | 195 | !(s->s3->flags & TLS1_FLAGS_KEEP_HANDSHAKE)) { |
| @@ -204,7 +204,7 @@ ssl3_finish_mac(SSL *s, const unsigned char *buf, int len) | |||
| 204 | } | 204 | } |
| 205 | 205 | ||
| 206 | int | 206 | int |
| 207 | ssl3_digest_cached_records(SSL *s) | 207 | tls1_digest_cached_records(SSL *s) |
| 208 | { | 208 | { |
| 209 | int i; | 209 | int i; |
| 210 | long mask; | 210 | long mask; |
| @@ -212,7 +212,7 @@ ssl3_digest_cached_records(SSL *s) | |||
| 212 | long hdatalen; | 212 | long hdatalen; |
| 213 | void *hdata; | 213 | void *hdata; |
| 214 | 214 | ||
| 215 | ssl3_free_digest_list(s); | 215 | tls1_free_digest_list(s); |
| 216 | 216 | ||
| 217 | s->s3->handshake_dgst = calloc(SSL_MAX_DIGEST, sizeof(EVP_MD_CTX *)); | 217 | s->s3->handshake_dgst = calloc(SSL_MAX_DIGEST, sizeof(EVP_MD_CTX *)); |
| 218 | if (s->s3->handshake_dgst == NULL) { | 218 | if (s->s3->handshake_dgst == NULL) { |
| @@ -255,7 +255,7 @@ ssl3_digest_cached_records(SSL *s) | |||
| 255 | } | 255 | } |
| 256 | 256 | ||
| 257 | void | 257 | void |
| 258 | ssl3_record_sequence_increment(unsigned char *seq) | 258 | tls1_record_sequence_increment(unsigned char *seq) |
| 259 | { | 259 | { |
| 260 | int i; | 260 | int i; |
| 261 | 261 | ||
| @@ -738,7 +738,7 @@ tls1_setup_key_block(SSL *s) | |||
| 738 | s->s3->tmp.new_mac_pkey_type = mac_type; | 738 | s->s3->tmp.new_mac_pkey_type = mac_type; |
| 739 | s->s3->tmp.new_mac_secret_size = mac_secret_size; | 739 | s->s3->tmp.new_mac_secret_size = mac_secret_size; |
| 740 | 740 | ||
| 741 | ssl3_cleanup_key_block(s); | 741 | tls1_cleanup_key_block(s); |
| 742 | 742 | ||
| 743 | if ((key_block = reallocarray(NULL, mac_secret_size + key_len + iv_len, | 743 | if ((key_block = reallocarray(NULL, mac_secret_size + key_len + iv_len, |
| 744 | 2)) == NULL) { | 744 | 2)) == NULL) { |
| @@ -827,7 +827,7 @@ tls1_enc(SSL *s, int send) | |||
| 827 | send ? s->d1->w_epoch : s->d1->r_epoch); | 827 | send ? s->d1->w_epoch : s->d1->r_epoch); |
| 828 | } else { | 828 | } else { |
| 829 | memcpy(ad, seq, SSL3_SEQUENCE_SIZE); | 829 | memcpy(ad, seq, SSL3_SEQUENCE_SIZE); |
| 830 | ssl3_record_sequence_increment(seq); | 830 | tls1_record_sequence_increment(seq); |
| 831 | } | 831 | } |
| 832 | 832 | ||
| 833 | ad[8] = rec->type; | 833 | ad[8] = rec->type; |
| @@ -975,7 +975,7 @@ tls1_enc(SSL *s, int send) | |||
| 975 | send ? s->d1->w_epoch : s->d1->r_epoch); | 975 | send ? s->d1->w_epoch : s->d1->r_epoch); |
| 976 | } else { | 976 | } else { |
| 977 | memcpy(buf, seq, SSL3_SEQUENCE_SIZE); | 977 | memcpy(buf, seq, SSL3_SEQUENCE_SIZE); |
| 978 | ssl3_record_sequence_increment(seq); | 978 | tls1_record_sequence_increment(seq); |
| 979 | } | 979 | } |
| 980 | 980 | ||
| 981 | buf[8] = rec->type; | 981 | buf[8] = rec->type; |
| @@ -1035,7 +1035,7 @@ tls1_cert_verify_mac(SSL *s, int md_nid, unsigned char *out) | |||
| 1035 | int i; | 1035 | int i; |
| 1036 | 1036 | ||
| 1037 | if (s->s3->handshake_buffer) | 1037 | if (s->s3->handshake_buffer) |
| 1038 | if (!ssl3_digest_cached_records(s)) | 1038 | if (!tls1_digest_cached_records(s)) |
| 1039 | return 0; | 1039 | return 0; |
| 1040 | 1040 | ||
| 1041 | for (i = 0; i < SSL_MAX_DIGEST; i++) { | 1041 | for (i = 0; i < SSL_MAX_DIGEST; i++) { |
| @@ -1074,7 +1074,7 @@ tls1_final_finish_mac(SSL *s, const char *str, int slen, unsigned char *out) | |||
| 1074 | q = buf; | 1074 | q = buf; |
| 1075 | 1075 | ||
| 1076 | if (s->s3->handshake_buffer) | 1076 | if (s->s3->handshake_buffer) |
| 1077 | if (!ssl3_digest_cached_records(s)) | 1077 | if (!tls1_digest_cached_records(s)) |
| 1078 | return 0; | 1078 | return 0; |
| 1079 | 1079 | ||
| 1080 | EVP_MD_CTX_init(&ctx); | 1080 | EVP_MD_CTX_init(&ctx); |
| @@ -1188,7 +1188,7 @@ tls1_mac(SSL *ssl, unsigned char *md, int send) | |||
| 1188 | EVP_MD_CTX_cleanup(&hmac); | 1188 | EVP_MD_CTX_cleanup(&hmac); |
| 1189 | 1189 | ||
| 1190 | if (!SSL_IS_DTLS(ssl)) | 1190 | if (!SSL_IS_DTLS(ssl)) |
| 1191 | ssl3_record_sequence_increment(seq); | 1191 | tls1_record_sequence_increment(seq); |
| 1192 | 1192 | ||
| 1193 | return (md_size); | 1193 | return (md_size); |
| 1194 | } | 1194 | } |
