diff options
author | jsing <> | 2014-06-15 15:29:25 +0000 |
---|---|---|
committer | jsing <> | 2014-06-15 15:29:25 +0000 |
commit | 2a844ef43b13fc36ea1f6191afa62385ea91a7d3 (patch) | |
tree | 419e62752148fee61938af501496eb61e95396a0 /src/lib/libssl/t1_enc.c | |
parent | 58b0b59173dbb3943c42d0b34806b7adad2ef68c (diff) | |
download | openbsd-2a844ef43b13fc36ea1f6191afa62385ea91a7d3.tar.gz openbsd-2a844ef43b13fc36ea1f6191afa62385ea91a7d3.tar.bz2 openbsd-2a844ef43b13fc36ea1f6191afa62385ea91a7d3.zip |
Rename ssl3_record_sequence_update() to ssl3_record_sequence_increment(),
so that it reflects what it is actually doing. Use this function in a
number of places that still have the hand rolled version.
ok beck@ miod@
Diffstat (limited to 'src/lib/libssl/t1_enc.c')
-rw-r--r-- | src/lib/libssl/t1_enc.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/src/lib/libssl/t1_enc.c b/src/lib/libssl/t1_enc.c index fe8ccab23e..c8fed159e7 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.59 2014/06/13 16:09:15 jsing Exp $ */ | 1 | /* $OpenBSD: t1_enc.c,v 1.60 2014/06/15 15:29:25 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 | * |
@@ -803,11 +803,7 @@ tls1_enc(SSL *s, int send) | |||
803 | memcpy(ad, dtlsseq, 8); | 803 | memcpy(ad, dtlsseq, 8); |
804 | } else { | 804 | } else { |
805 | memcpy(ad, seq, SSL3_SEQUENCE_SIZE); | 805 | memcpy(ad, seq, SSL3_SEQUENCE_SIZE); |
806 | for (i = 7; i >= 0; i--) { | 806 | ssl3_record_sequence_increment(seq); |
807 | ++seq[i]; | ||
808 | if (seq[i] != 0) | ||
809 | break; | ||
810 | } | ||
811 | } | 807 | } |
812 | 808 | ||
813 | ad[8] = rec->type; | 809 | ad[8] = rec->type; |
@@ -964,11 +960,7 @@ tls1_enc(SSL *s, int send) | |||
964 | memcpy(buf, dtlsseq, 8); | 960 | memcpy(buf, dtlsseq, 8); |
965 | } else { | 961 | } else { |
966 | memcpy(buf, seq, SSL3_SEQUENCE_SIZE); | 962 | memcpy(buf, seq, SSL3_SEQUENCE_SIZE); |
967 | for (i = 7; i >= 0; i--) { /* increment */ | 963 | ssl3_record_sequence_increment(seq); |
968 | ++seq[i]; | ||
969 | if (seq[i] != 0) | ||
970 | break; | ||
971 | } | ||
972 | } | 964 | } |
973 | 965 | ||
974 | buf[8] = rec->type; | 966 | buf[8] = rec->type; |
@@ -1117,7 +1109,6 @@ tls1_mac(SSL *ssl, unsigned char *md, int send) | |||
1117 | unsigned char *seq; | 1109 | unsigned char *seq; |
1118 | EVP_MD_CTX *hash; | 1110 | EVP_MD_CTX *hash; |
1119 | size_t md_size, orig_len; | 1111 | size_t md_size, orig_len; |
1120 | int i; | ||
1121 | EVP_MD_CTX hmac, *mac_ctx; | 1112 | EVP_MD_CTX hmac, *mac_ctx; |
1122 | unsigned char header[13]; | 1113 | unsigned char header[13]; |
1123 | int stream_mac = (send ? | 1114 | int stream_mac = (send ? |
@@ -1191,13 +1182,8 @@ tls1_mac(SSL *ssl, unsigned char *md, int send) | |||
1191 | if (!stream_mac) | 1182 | if (!stream_mac) |
1192 | EVP_MD_CTX_cleanup(&hmac); | 1183 | EVP_MD_CTX_cleanup(&hmac); |
1193 | 1184 | ||
1194 | if (!SSL_IS_DTLS(ssl)) { | 1185 | if (!SSL_IS_DTLS(ssl)) |
1195 | for (i = 7; i >= 0; i--) { | 1186 | ssl3_record_sequence_increment(seq); |
1196 | ++seq[i]; | ||
1197 | if (seq[i] != 0) | ||
1198 | break; | ||
1199 | } | ||
1200 | } | ||
1201 | 1187 | ||
1202 | return (md_size); | 1188 | return (md_size); |
1203 | } | 1189 | } |