diff options
author | djm <> | 2012-01-05 22:59:13 +0000 |
---|---|---|
committer | djm <> | 2012-01-05 22:59:13 +0000 |
commit | 35dadfe897866818c3fd0350efefc5caae349fb6 (patch) | |
tree | ea8a5e48de5536cee121f93d151f597f81bb005f /src | |
parent | a6e41415ac962ded0ce163ad37d0f5eda1525e1b (diff) | |
parent | 731838c66b52c0ae5888333005b74115a620aa96 (diff) | |
download | openbsd-35dadfe897866818c3fd0350efefc5caae349fb6.tar.gz openbsd-35dadfe897866818c3fd0350efefc5caae349fb6.tar.bz2 openbsd-35dadfe897866818c3fd0350efefc5caae349fb6.zip |
This commit was generated by cvs2git to track changes on a CVS vendor
branch.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/bn/asm/ppc.pl | 2 | ||||
-rwxr-xr-x | src/lib/libcrypto/bn/asm/x86-mont.pl | 4 | ||||
-rw-r--r-- | src/lib/libssl/d1_both.c | 23 | ||||
-rw-r--r-- | src/lib/libssl/d1_lib.c | 9 |
4 files changed, 28 insertions, 10 deletions
diff --git a/src/lib/libcrypto/bn/asm/ppc.pl b/src/lib/libcrypto/bn/asm/ppc.pl index 37c65d3511..f4093177e6 100644 --- a/src/lib/libcrypto/bn/asm/ppc.pl +++ b/src/lib/libcrypto/bn/asm/ppc.pl | |||
@@ -949,7 +949,7 @@ $data=<<EOF; | |||
949 | addze r11,r0 | 949 | addze r11,r0 |
950 | #mul_add_c(a[3],b[2],c3,c1,c2); | 950 | #mul_add_c(a[3],b[2],c3,c1,c2); |
951 | $LD r6,`3*$BNSZ`(r4) | 951 | $LD r6,`3*$BNSZ`(r4) |
952 | $LD r7,`2*$BNSZ`(r4) | 952 | $LD r7,`2*$BNSZ`(r5) |
953 | $UMULL r8,r6,r7 | 953 | $UMULL r8,r6,r7 |
954 | $UMULH r9,r6,r7 | 954 | $UMULH r9,r6,r7 |
955 | addc r12,r8,r12 | 955 | addc r12,r8,r12 |
diff --git a/src/lib/libcrypto/bn/asm/x86-mont.pl b/src/lib/libcrypto/bn/asm/x86-mont.pl index 5cd3cd2ed5..e8f6b05084 100755 --- a/src/lib/libcrypto/bn/asm/x86-mont.pl +++ b/src/lib/libcrypto/bn/asm/x86-mont.pl | |||
@@ -527,8 +527,10 @@ $sbit=$num; | |||
527 | &jle (&label("sqradd")); | 527 | &jle (&label("sqradd")); |
528 | 528 | ||
529 | &mov ($carry,"edx"); | 529 | &mov ($carry,"edx"); |
530 | &lea ("edx",&DWP(0,$sbit,"edx",2)); | 530 | &add ("edx","edx"); |
531 | &shr ($carry,31); | 531 | &shr ($carry,31); |
532 | &add ("edx",$sbit); | ||
533 | &adc ($carry,0); | ||
532 | &set_label("sqrlast"); | 534 | &set_label("sqrlast"); |
533 | &mov ($word,$_n0); | 535 | &mov ($word,$_n0); |
534 | &mov ($inp,$_np); | 536 | &mov ($inp,$_np); |
diff --git a/src/lib/libssl/d1_both.c b/src/lib/libssl/d1_both.c index 2180c6d4da..9f898d6997 100644 --- a/src/lib/libssl/d1_both.c +++ b/src/lib/libssl/d1_both.c | |||
@@ -158,7 +158,6 @@ static unsigned char bitmask_end_values[] = {0xff, 0x01, 0x03, 0x07, 0x0f, 0x1 | |||
158 | /* XDTLS: figure out the right values */ | 158 | /* XDTLS: figure out the right values */ |
159 | static unsigned int g_probable_mtu[] = {1500 - 28, 512 - 28, 256 - 28}; | 159 | static unsigned int g_probable_mtu[] = {1500 - 28, 512 - 28, 256 - 28}; |
160 | 160 | ||
161 | static unsigned int dtls1_min_mtu(void); | ||
162 | static unsigned int dtls1_guess_mtu(unsigned int curr_mtu); | 161 | static unsigned int dtls1_guess_mtu(unsigned int curr_mtu); |
163 | static void dtls1_fix_message_header(SSL *s, unsigned long frag_off, | 162 | static void dtls1_fix_message_header(SSL *s, unsigned long frag_off, |
164 | unsigned long frag_len); | 163 | unsigned long frag_len); |
@@ -264,11 +263,10 @@ int dtls1_do_write(SSL *s, int type) | |||
264 | return ret; | 263 | return ret; |
265 | mtu = s->d1->mtu - (DTLS1_HM_HEADER_LENGTH + DTLS1_RT_HEADER_LENGTH); | 264 | mtu = s->d1->mtu - (DTLS1_HM_HEADER_LENGTH + DTLS1_RT_HEADER_LENGTH); |
266 | } | 265 | } |
267 | |||
268 | OPENSSL_assert(mtu > 0); /* should have something reasonable now */ | ||
269 | |||
270 | #endif | 266 | #endif |
271 | 267 | ||
268 | OPENSSL_assert(s->d1->mtu >= dtls1_min_mtu()); /* should have something reasonable now */ | ||
269 | |||
272 | if ( s->init_off == 0 && type == SSL3_RT_HANDSHAKE) | 270 | if ( s->init_off == 0 && type == SSL3_RT_HANDSHAKE) |
273 | OPENSSL_assert(s->init_num == | 271 | OPENSSL_assert(s->init_num == |
274 | (int)s->d1->w_msg_hdr.msg_len + DTLS1_HM_HEADER_LENGTH); | 272 | (int)s->d1->w_msg_hdr.msg_len + DTLS1_HM_HEADER_LENGTH); |
@@ -795,7 +793,13 @@ dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok) | |||
795 | *ok = 0; | 793 | *ok = 0; |
796 | return i; | 794 | return i; |
797 | } | 795 | } |
798 | OPENSSL_assert(i == DTLS1_HM_HEADER_LENGTH); | 796 | /* Handshake fails if message header is incomplete */ |
797 | if (i != DTLS1_HM_HEADER_LENGTH) | ||
798 | { | ||
799 | al=SSL_AD_UNEXPECTED_MESSAGE; | ||
800 | SSLerr(SSL_F_DTLS1_GET_MESSAGE_FRAGMENT,SSL_R_UNEXPECTED_MESSAGE); | ||
801 | goto f_err; | ||
802 | } | ||
799 | 803 | ||
800 | /* parse the message fragment header */ | 804 | /* parse the message fragment header */ |
801 | dtls1_get_message_header(wire, &msg_hdr); | 805 | dtls1_get_message_header(wire, &msg_hdr); |
@@ -867,7 +871,12 @@ dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok) | |||
867 | 871 | ||
868 | /* XDTLS: an incorrectly formatted fragment should cause the | 872 | /* XDTLS: an incorrectly formatted fragment should cause the |
869 | * handshake to fail */ | 873 | * handshake to fail */ |
870 | OPENSSL_assert(i == (int)frag_len); | 874 | if (i != (int)frag_len) |
875 | { | ||
876 | al=SSL3_AD_ILLEGAL_PARAMETER; | ||
877 | SSLerr(SSL_F_DTLS1_GET_MESSAGE_FRAGMENT,SSL3_AD_ILLEGAL_PARAMETER); | ||
878 | goto f_err; | ||
879 | } | ||
871 | 880 | ||
872 | *ok = 1; | 881 | *ok = 1; |
873 | 882 | ||
@@ -1367,7 +1376,7 @@ dtls1_write_message_header(SSL *s, unsigned char *p) | |||
1367 | return p; | 1376 | return p; |
1368 | } | 1377 | } |
1369 | 1378 | ||
1370 | static unsigned int | 1379 | unsigned int |
1371 | dtls1_min_mtu(void) | 1380 | dtls1_min_mtu(void) |
1372 | { | 1381 | { |
1373 | return (g_probable_mtu[(sizeof(g_probable_mtu) / | 1382 | return (g_probable_mtu[(sizeof(g_probable_mtu) / |
diff --git a/src/lib/libssl/d1_lib.c b/src/lib/libssl/d1_lib.c index 48e8b6ffbb..c3b77c889b 100644 --- a/src/lib/libssl/d1_lib.c +++ b/src/lib/libssl/d1_lib.c | |||
@@ -204,7 +204,8 @@ void dtls1_clear(SSL *s) | |||
204 | pqueue buffered_messages; | 204 | pqueue buffered_messages; |
205 | pqueue sent_messages; | 205 | pqueue sent_messages; |
206 | pqueue buffered_app_data; | 206 | pqueue buffered_app_data; |
207 | 207 | unsigned int mtu; | |
208 | |||
208 | if (s->d1) | 209 | if (s->d1) |
209 | { | 210 | { |
210 | unprocessed_rcds = s->d1->unprocessed_rcds.q; | 211 | unprocessed_rcds = s->d1->unprocessed_rcds.q; |
@@ -212,6 +213,7 @@ void dtls1_clear(SSL *s) | |||
212 | buffered_messages = s->d1->buffered_messages; | 213 | buffered_messages = s->d1->buffered_messages; |
213 | sent_messages = s->d1->sent_messages; | 214 | sent_messages = s->d1->sent_messages; |
214 | buffered_app_data = s->d1->buffered_app_data.q; | 215 | buffered_app_data = s->d1->buffered_app_data.q; |
216 | mtu = s->d1->mtu; | ||
215 | 217 | ||
216 | dtls1_clear_queues(s); | 218 | dtls1_clear_queues(s); |
217 | 219 | ||
@@ -222,6 +224,11 @@ void dtls1_clear(SSL *s) | |||
222 | s->d1->cookie_len = sizeof(s->d1->cookie); | 224 | s->d1->cookie_len = sizeof(s->d1->cookie); |
223 | } | 225 | } |
224 | 226 | ||
227 | if (SSL_get_options(s) & SSL_OP_NO_QUERY_MTU) | ||
228 | { | ||
229 | s->d1->mtu = mtu; | ||
230 | } | ||
231 | |||
225 | s->d1->unprocessed_rcds.q = unprocessed_rcds; | 232 | s->d1->unprocessed_rcds.q = unprocessed_rcds; |
226 | s->d1->processed_rcds.q = processed_rcds; | 233 | s->d1->processed_rcds.q = processed_rcds; |
227 | s->d1->buffered_messages = buffered_messages; | 234 | s->d1->buffered_messages = buffered_messages; |