From d9c21bb8bdb71d3b8c5ef3d73ea73e288e98136e Mon Sep 17 00:00:00 2001 From: tedu Date: Wed, 16 Apr 2014 18:23:52 +0000 Subject: [PATCH] fix a few bugs observed on http://www.viva64.com/en/b/0250/ ok krw miod --- lib/libcrypto/asn1/asn1_gen.c | 2 +- lib/libcrypto/asn1/asn1_par.c | 2 +- lib/libssl/d1_both.c | 1 - lib/libssl/src/apps/s_server.c | 2 +- lib/libssl/src/crypto/asn1/asn1_gen.c | 2 +- lib/libssl/src/crypto/asn1/asn1_par.c | 2 +- lib/libssl/src/ssl/d1_both.c | 1 - 7 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/libcrypto/asn1/asn1_gen.c b/lib/libcrypto/asn1/asn1_gen.c index 4fc241908f6..81a7a38895a 100644 --- a/lib/libcrypto/asn1/asn1_gen.c +++ b/lib/libcrypto/asn1/asn1_gen.c @@ -368,7 +368,7 @@ static int asn1_cb(const char *elem, int len, void *bitstr) arg->format = ASN1_GEN_FORMAT_UTF8; else if (!strncmp(vstart, "HEX", 3)) arg->format = ASN1_GEN_FORMAT_HEX; - else if (!strncmp(vstart, "BITLIST", 3)) + else if (!strncmp(vstart, "BITLIST", 7)) arg->format = ASN1_GEN_FORMAT_BITLIST; else { diff --git a/lib/libcrypto/asn1/asn1_par.c b/lib/libcrypto/asn1/asn1_par.c index 29b0ba46b5d..e34c75a4184 100644 --- a/lib/libcrypto/asn1/asn1_par.c +++ b/lib/libcrypto/asn1/asn1_par.c @@ -375,7 +375,7 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length, int offse } else { - if (BIO_write(bp,"BAD ENUMERATED",11) <= 0) + if (BIO_write(bp,"BAD ENUMERATED",14) <= 0) goto end; } M_ASN1_ENUMERATED_free(bs); diff --git a/lib/libssl/d1_both.c b/lib/libssl/d1_both.c index ab6b1684107..731245c6a6c 100644 --- a/lib/libssl/d1_both.c +++ b/lib/libssl/d1_both.c @@ -1213,7 +1213,6 @@ dtls1_retransmit_message(SSL *s, unsigned short seq, unsigned long frag_off, saved_state.compress = s->compress; saved_state.session = s->session; saved_state.epoch = s->d1->w_epoch; - saved_state.epoch = s->d1->w_epoch; s->d1->retransmitting = 1; diff --git a/lib/libssl/src/apps/s_server.c b/lib/libssl/src/apps/s_server.c index 8d7568085a1..74cd2c83b3c 100644 --- a/lib/libssl/src/apps/s_server.c +++ b/lib/libssl/src/apps/s_server.c @@ -2494,7 +2494,7 @@ static int www_body(char *hostname, int s, unsigned char *context) /* else we have data */ if ( ((www == 1) && (strncmp("GET ",buf,4) == 0)) || - ((www == 2) && (strncmp("GET /stats ",buf,10) == 0))) + ((www == 2) && (strncmp("GET /stats ",buf,11) == 0))) { char *p; X509 *peer; diff --git a/lib/libssl/src/crypto/asn1/asn1_gen.c b/lib/libssl/src/crypto/asn1/asn1_gen.c index 4fc241908f6..81a7a38895a 100644 --- a/lib/libssl/src/crypto/asn1/asn1_gen.c +++ b/lib/libssl/src/crypto/asn1/asn1_gen.c @@ -368,7 +368,7 @@ static int asn1_cb(const char *elem, int len, void *bitstr) arg->format = ASN1_GEN_FORMAT_UTF8; else if (!strncmp(vstart, "HEX", 3)) arg->format = ASN1_GEN_FORMAT_HEX; - else if (!strncmp(vstart, "BITLIST", 3)) + else if (!strncmp(vstart, "BITLIST", 7)) arg->format = ASN1_GEN_FORMAT_BITLIST; else { diff --git a/lib/libssl/src/crypto/asn1/asn1_par.c b/lib/libssl/src/crypto/asn1/asn1_par.c index 29b0ba46b5d..e34c75a4184 100644 --- a/lib/libssl/src/crypto/asn1/asn1_par.c +++ b/lib/libssl/src/crypto/asn1/asn1_par.c @@ -375,7 +375,7 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length, int offse } else { - if (BIO_write(bp,"BAD ENUMERATED",11) <= 0) + if (BIO_write(bp,"BAD ENUMERATED",14) <= 0) goto end; } M_ASN1_ENUMERATED_free(bs); diff --git a/lib/libssl/src/ssl/d1_both.c b/lib/libssl/src/ssl/d1_both.c index ab6b1684107..731245c6a6c 100644 --- a/lib/libssl/src/ssl/d1_both.c +++ b/lib/libssl/src/ssl/d1_both.c @@ -1213,7 +1213,6 @@ dtls1_retransmit_message(SSL *s, unsigned short seq, unsigned long frag_off, saved_state.compress = s->compress; saved_state.session = s->session; saved_state.epoch = s->d1->w_epoch; - saved_state.epoch = s->d1->w_epoch; s->d1->retransmitting = 1; -- 2.20.1