summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2016-12-03 12:34:35 +0000
committerjsing <>2016-12-03 12:34:35 +0000
commitaf83ada514fa464f3509c3fea817e54aec9e8ed5 (patch)
tree8ef275a8ac5312337c385a03eb510a3b70e33eaa
parent0d9fc4b27df17ee9113ab05bb64756708099eadf (diff)
downloadopenbsd-af83ada514fa464f3509c3fea817e54aec9e8ed5.tar.gz
openbsd-af83ada514fa464f3509c3fea817e54aec9e8ed5.tar.bz2
openbsd-af83ada514fa464f3509c3fea817e54aec9e8ed5.zip
Avoid signed vs unsigned warnings from clang by adding two casts,
slightly rewriting some code and changing the type of an array. ok bcook@ doug@
-rw-r--r--src/lib/libssl/bs_ber.c6
-rw-r--r--src/lib/libssl/s3_clnt.c4
-rw-r--r--src/lib/libssl/s3_srvr.c4
-rw-r--r--src/lib/libssl/ssl_asn1.c4
4 files changed, 10 insertions, 8 deletions
diff --git a/src/lib/libssl/bs_ber.c b/src/lib/libssl/bs_ber.c
index 6e945a0246..7863b8be0c 100644
--- a/src/lib/libssl/bs_ber.c
+++ b/src/lib/libssl/bs_ber.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bs_ber.c,v 1.8 2015/06/21 16:10:45 doug Exp $ */ 1/* $OpenBSD: bs_ber.c,v 1.9 2016/12/03 12:34:35 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2014, Google Inc. 3 * Copyright (c) 2014, Google Inc.
4 * 4 *
@@ -103,7 +103,9 @@ is_primitive_type(unsigned int tag)
103static char 103static char
104is_eoc(size_t header_len, CBS *contents) 104is_eoc(size_t header_len, CBS *contents)
105{ 105{
106 return header_len == 2 && CBS_mem_equal(contents, "\x00\x00", 2); 106 const unsigned char eoc[] = {0x0, 0x0};
107
108 return header_len == 2 && CBS_mem_equal(contents, eoc, 2);
107} 109}
108 110
109/* 111/*
diff --git a/src/lib/libssl/s3_clnt.c b/src/lib/libssl/s3_clnt.c
index 57c11f458a..08b804dcfe 100644
--- a/src/lib/libssl/s3_clnt.c
+++ b/src/lib/libssl/s3_clnt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s3_clnt.c,v 1.145 2016/11/06 09:44:51 bcook Exp $ */ 1/* $OpenBSD: s3_clnt.c,v 1.146 2016/12/03 12:34:35 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 *
@@ -1574,7 +1574,7 @@ ssl3_get_certificate_request(SSL *s)
1574 if (ctype_num > SSL3_CT_NUMBER) 1574 if (ctype_num > SSL3_CT_NUMBER)
1575 ctype_num = SSL3_CT_NUMBER; 1575 ctype_num = SSL3_CT_NUMBER;
1576 if (!CBS_get_bytes(&cert_request, &ctypes, ctype_num) || 1576 if (!CBS_get_bytes(&cert_request, &ctypes, ctype_num) ||
1577 !CBS_write_bytes(&ctypes, s->s3->tmp.ctype, 1577 !CBS_write_bytes(&ctypes, (uint8_t *)s->s3->tmp.ctype,
1578 sizeof(s->s3->tmp.ctype), NULL)) { 1578 sizeof(s->s3->tmp.ctype), NULL)) {
1579 SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, 1579 SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST,
1580 SSL_R_DATA_LENGTH_TOO_LONG); 1580 SSL_R_DATA_LENGTH_TOO_LONG);
diff --git a/src/lib/libssl/s3_srvr.c b/src/lib/libssl/s3_srvr.c
index e0d16e5cf2..0873437fcb 100644
--- a/src/lib/libssl/s3_srvr.c
+++ b/src/lib/libssl/s3_srvr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s3_srvr.c,v 1.133 2016/11/17 15:22:41 jsing Exp $ */ 1/* $OpenBSD: s3_srvr.c,v 1.134 2016/12/03 12:34:35 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 *
@@ -1632,7 +1632,7 @@ err:
1632static int 1632static int
1633ssl3_get_client_kex_rsa(SSL *s, unsigned char *p, long n) 1633ssl3_get_client_kex_rsa(SSL *s, unsigned char *p, long n)
1634{ 1634{
1635 char fakekey[SSL_MAX_MASTER_KEY_LENGTH]; 1635 unsigned char fakekey[SSL_MAX_MASTER_KEY_LENGTH];
1636 unsigned char *d; 1636 unsigned char *d;
1637 RSA *rsa = NULL; 1637 RSA *rsa = NULL;
1638 EVP_PKEY *pkey = NULL; 1638 EVP_PKEY *pkey = NULL;
diff --git a/src/lib/libssl/ssl_asn1.c b/src/lib/libssl/ssl_asn1.c
index 02124da520..1b93886868 100644
--- a/src/lib/libssl/ssl_asn1.c
+++ b/src/lib/libssl/ssl_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_asn1.c,v 1.43 2016/11/05 19:59:01 miod Exp $ */ 1/* $OpenBSD: ssl_asn1.c,v 1.44 2016/12/03 12:34:35 jsing Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2016 Joel Sing <jsing@openbsd.org> 4 * Copyright (c) 2016 Joel Sing <jsing@openbsd.org>
@@ -158,7 +158,7 @@ i2d_SSL_SESSION(SSL_SESSION *s, unsigned char **pp)
158 goto err; 158 goto err;
159 if (!CBB_add_asn1(&hostname, &value, CBS_ASN1_OCTETSTRING)) 159 if (!CBB_add_asn1(&hostname, &value, CBS_ASN1_OCTETSTRING))
160 goto err; 160 goto err;
161 if (!CBB_add_bytes(&value, s->tlsext_hostname, 161 if (!CBB_add_bytes(&value, (const uint8_t *)s->tlsext_hostname,
162 strlen(s->tlsext_hostname))) 162 strlen(s->tlsext_hostname)))
163 goto err; 163 goto err;
164 } 164 }