aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2017-12-07 17:37:15 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2017-12-07 17:37:15 +0000
commit4f94f84d8491a2455678402b5c7c92e692a272bc (patch)
treea4aa27b5b96b57155a4e7c22defb8f25e93cb846 /apps
parentb6a9311a3edd056eaacbcbae2fcb723df5d99057 (diff)
downloadsrc-4f94f84d8491a2455678402b5c7c92e692a272bc.tar.gz
src-4f94f84d8491a2455678402b5c7c92e692a272bc.zip
Import OpenSSL 1.0.2n.vendor/openssl/1.0.2n
Notes
Notes: svn path=/vendor-crypto/openssl/dist/; revision=326660 svn path=/vendor-crypto/openssl/1.0.2n/; revision=326661; tag=vendor/openssl/1.0.2n
Diffstat (limited to 'apps')
-rw-r--r--apps/apps.c8
-rw-r--r--apps/dsa.c3
-rw-r--r--apps/s_client.c9
-rw-r--r--apps/speed.c4
4 files changed, 16 insertions, 8 deletions
diff --git a/apps/apps.c b/apps/apps.c
index c487bd92db2a..29de1b75dd60 100644
--- a/apps/apps.c
+++ b/apps/apps.c
@@ -148,6 +148,10 @@
#ifdef _WIN32
static int WIN32_rename(const char *from, const char *to);
# define rename(from,to) WIN32_rename((from),(to))
+# ifdef fileno
+# undef fileno
+# endif
+# define fileno(a) (int)_fileno(a)
#endif
typedef struct {
@@ -2788,13 +2792,13 @@ unsigned char *next_protos_parse(unsigned short *outlen, const char *in)
OPENSSL_free(out);
return NULL;
}
- out[start] = i - start;
+ out[start] = (unsigned char)(i - start);
start = i + 1;
} else
out[i + 1] = in[i];
}
- *outlen = len + 1;
+ *outlen = (unsigned char)(len + 1);
return out;
}
#endif /* ndef OPENSSL_NO_TLSEXT */
diff --git a/apps/dsa.c b/apps/dsa.c
index 4ed21d891e86..82a870eb2910 100644
--- a/apps/dsa.c
+++ b/apps/dsa.c
@@ -327,6 +327,9 @@ int MAIN(int argc, char **argv)
} else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
EVP_PKEY *pk;
pk = EVP_PKEY_new();
+ if (pk == NULL)
+ goto end;
+
EVP_PKEY_set1_DSA(pk, dsa);
if (outformat == FORMAT_PVK)
i = i2b_PVK_bio(out, pk, pvk_encr, 0, passout);
diff --git a/apps/s_client.c b/apps/s_client.c
index dc467994f8e2..2a0ead7beffb 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -630,10 +630,11 @@ static int serverinfo_cli_parse_cb(SSL *s, unsigned int ext_type,
unsigned char ext_buf[4 + 65536];
/* Reconstruct the type/len fields prior to extension data */
- ext_buf[0] = ext_type >> 8;
- ext_buf[1] = ext_type & 0xFF;
- ext_buf[2] = inlen >> 8;
- ext_buf[3] = inlen & 0xFF;
+ inlen &= 0xffff; /* for formal memcpy correctness */
+ ext_buf[0] = (unsigned char)(ext_type >> 8);
+ ext_buf[1] = (unsigned char)(ext_type);
+ ext_buf[2] = (unsigned char)(inlen >> 8);
+ ext_buf[3] = (unsigned char)(inlen);
memcpy(ext_buf + 4, in, inlen);
BIO_snprintf(pem_name, sizeof(pem_name), "SERVERINFO FOR EXTENSION %d",
diff --git a/apps/speed.c b/apps/speed.c
index 5259c16f1218..5383678b9864 100644
--- a/apps/speed.c
+++ b/apps/speed.c
@@ -2829,8 +2829,8 @@ static void multiblock_speed(const EVP_CIPHER *evp_cipher)
RAND_bytes(out, 16);
len += 16;
- aad[11] = len >> 8;
- aad[12] = len;
+ aad[11] = (unsigned char)(len >> 8);
+ aad[12] = (unsigned char)(len);
pad = EVP_CIPHER_CTX_ctrl(&ctx,
EVP_CTRL_AEAD_TLS1_AAD,
EVP_AEAD_TLS1_AAD_LEN, aad);