summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormiod <>2014-05-24 15:18:58 +0000
committermiod <>2014-05-24 15:18:58 +0000
commit729266c835d0df1fa80f6ee817646b9a38b42542 (patch)
tree32dda4ae203d189a30cde994e9ca4ac8b4d196aa /src
parenta97aa166153b5cc46ce3e1362e35b93a5e7405fb (diff)
downloadopenbsd-729266c835d0df1fa80f6ee817646b9a38b42542.tar.gz
openbsd-729266c835d0df1fa80f6ee817646b9a38b42542.tar.bz2
openbsd-729266c835d0df1fa80f6ee817646b9a38b42542.zip
Use sizeof(cryptopro_ext) instead of 36 when applicable.
ok jsing@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/src/ssl/t1_lib.c8
-rw-r--r--src/lib/libssl/t1_lib.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/libssl/src/ssl/t1_lib.c b/src/lib/libssl/src/ssl/t1_lib.c
index 6913d15663..e01b7bdb10 100644
--- a/src/lib/libssl/src/ssl/t1_lib.c
+++ b/src/lib/libssl/src/ssl/t1_lib.c
@@ -791,7 +791,7 @@ ssl_add_serverhello_tlsext(SSL *s, unsigned char *p, unsigned char *limit)
791 if (((s->s3->tmp.new_cipher->id & 0xFFFF) == 0x80 || 791 if (((s->s3->tmp.new_cipher->id & 0xFFFF) == 0x80 ||
792 (s->s3->tmp.new_cipher->id & 0xFFFF) == 0x81) && 792 (s->s3->tmp.new_cipher->id & 0xFFFF) == 0x81) &&
793 (SSL_get_options(s) & SSL_OP_CRYPTOPRO_TLSEXT_BUG)) { 793 (SSL_get_options(s) & SSL_OP_CRYPTOPRO_TLSEXT_BUG)) {
794 const unsigned char cryptopro_ext[36] = { 794 static const unsigned char cryptopro_ext[36] = {
795 0xfd, 0xe8, /*65000*/ 795 0xfd, 0xe8, /*65000*/
796 0x00, 0x20, /*32 bytes length*/ 796 0x00, 0x20, /*32 bytes length*/
797 0x30, 0x1e, 0x30, 0x08, 0x06, 0x06, 0x2a, 0x85, 797 0x30, 0x1e, 0x30, 0x08, 0x06, 0x06, 0x2a, 0x85,
@@ -799,10 +799,10 @@ ssl_add_serverhello_tlsext(SSL *s, unsigned char *p, unsigned char *limit)
799 0x2a, 0x85, 0x03, 0x02, 0x02, 0x16, 0x30, 0x08, 799 0x2a, 0x85, 0x03, 0x02, 0x02, 0x16, 0x30, 0x08,
800 0x06, 0x06, 0x2a, 0x85, 0x03, 0x02, 0x02, 0x17 800 0x06, 0x06, 0x2a, 0x85, 0x03, 0x02, 0x02, 0x17
801 }; 801 };
802 if ((size_t)(limit - ret) < 36) 802 if ((size_t)(limit - ret) < sizeof(cryptopro_ext))
803 return NULL; 803 return NULL;
804 memcpy(ret, cryptopro_ext, 36); 804 memcpy(ret, cryptopro_ext, sizeof(cryptopro_ext));
805 ret += 36; 805 ret += sizeof(cryptopro_ext);
806 } 806 }
807 807
808#ifndef OPENSSL_NO_NEXTPROTONEG 808#ifndef OPENSSL_NO_NEXTPROTONEG
diff --git a/src/lib/libssl/t1_lib.c b/src/lib/libssl/t1_lib.c
index 6913d15663..e01b7bdb10 100644
--- a/src/lib/libssl/t1_lib.c
+++ b/src/lib/libssl/t1_lib.c
@@ -791,7 +791,7 @@ ssl_add_serverhello_tlsext(SSL *s, unsigned char *p, unsigned char *limit)
791 if (((s->s3->tmp.new_cipher->id & 0xFFFF) == 0x80 || 791 if (((s->s3->tmp.new_cipher->id & 0xFFFF) == 0x80 ||
792 (s->s3->tmp.new_cipher->id & 0xFFFF) == 0x81) && 792 (s->s3->tmp.new_cipher->id & 0xFFFF) == 0x81) &&
793 (SSL_get_options(s) & SSL_OP_CRYPTOPRO_TLSEXT_BUG)) { 793 (SSL_get_options(s) & SSL_OP_CRYPTOPRO_TLSEXT_BUG)) {
794 const unsigned char cryptopro_ext[36] = { 794 static const unsigned char cryptopro_ext[36] = {
795 0xfd, 0xe8, /*65000*/ 795 0xfd, 0xe8, /*65000*/
796 0x00, 0x20, /*32 bytes length*/ 796 0x00, 0x20, /*32 bytes length*/
797 0x30, 0x1e, 0x30, 0x08, 0x06, 0x06, 0x2a, 0x85, 797 0x30, 0x1e, 0x30, 0x08, 0x06, 0x06, 0x2a, 0x85,
@@ -799,10 +799,10 @@ ssl_add_serverhello_tlsext(SSL *s, unsigned char *p, unsigned char *limit)
799 0x2a, 0x85, 0x03, 0x02, 0x02, 0x16, 0x30, 0x08, 799 0x2a, 0x85, 0x03, 0x02, 0x02, 0x16, 0x30, 0x08,
800 0x06, 0x06, 0x2a, 0x85, 0x03, 0x02, 0x02, 0x17 800 0x06, 0x06, 0x2a, 0x85, 0x03, 0x02, 0x02, 0x17
801 }; 801 };
802 if ((size_t)(limit - ret) < 36) 802 if ((size_t)(limit - ret) < sizeof(cryptopro_ext))
803 return NULL; 803 return NULL;
804 memcpy(ret, cryptopro_ext, 36); 804 memcpy(ret, cryptopro_ext, sizeof(cryptopro_ext));
805 ret += 36; 805 ret += sizeof(cryptopro_ext);
806 } 806 }
807 807
808#ifndef OPENSSL_NO_NEXTPROTONEG 808#ifndef OPENSSL_NO_NEXTPROTONEG