Latest update.

This commit is contained in:
2020-04-15 18:45:34 +09:00
parent be29e7bcc6
commit 2015c00c43
573 changed files with 22943 additions and 6714 deletions
+52 -6
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
* Copyright 2005 Nokia. All rights reserved.
*
@@ -17,6 +17,7 @@
#include <openssl/dh.h>
#include <openssl/rand.h>
#include <openssl/trace.h>
#include <openssl/x509v3.h>
#include "internal/cryptlib.h"
#define TLS13_NUM_CIPHERS OSSL_NELEM(tls13_ciphers)
@@ -2690,7 +2691,23 @@ static SSL_CIPHER ssl3_ciphers[] = {
},
{
1,
"GOST2012-GOST8912-GOST8912",
"IANA-GOST2012-GOST8912-GOST8912",
NULL,
0x0300c102,
SSL_kGOST,
SSL_aGOST12 | SSL_aGOST01,
SSL_eGOST2814789CNT12,
SSL_GOST89MAC12,
TLS1_VERSION, TLS1_2_VERSION,
0, 0,
SSL_HIGH,
SSL_HANDSHAKE_MAC_GOST12_256 | TLS1_PRF_GOST12_256 | TLS1_STREAM_MAC,
256,
256,
},
{
1,
"LEGACY-GOST2012-GOST8912-GOST8912",
NULL,
0x0300ff85,
SSL_kGOST,
@@ -3998,6 +4015,10 @@ long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
return 0;
}
}
if (!X509v3_cache_extensions((X509 *)parg, ctx->libctx, ctx->propq)) {
SSLerr(0, ERR_LIB_X509);
return 0;
}
if (!sk_X509_push(ctx->extra_certs, (X509 *)parg)) {
SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_MALLOC_FAILURE);
return 0;
@@ -4695,7 +4716,7 @@ int ssl_generate_master_secret(SSL *s, unsigned char *pms, size_t pmslen,
OPENSSL_clear_free(s->s3.tmp.psk, psklen);
s->s3.tmp.psk = NULL;
if (!s->method->ssl3_enc->generate_master_secret(s,
s->session->master_key,pskpms, pskpmslen,
s->session->master_key, pskpms, pskpmslen,
&s->session->master_key_length)) {
OPENSSL_clear_free(pskpms, pskpmslen);
/* SSLfatal() already called */
@@ -4776,19 +4797,33 @@ EVP_PKEY *ssl_generate_pkey_group(SSL *s, uint16_t id)
*/
# ifndef OPENSSL_NO_DH
if (gtype == TLS_GROUP_FFDHE)
# if 0
pctx = EVP_PKEY_CTX_new_from_name(s->ctx->libctx, "DH", s->ctx->propq);
# else
pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_DH, NULL);
# endif
# ifndef OPENSSL_NO_EC
else
# endif
# endif
# endif /* OPENSSL_NO_EC */
# endif /* OPENSSL_NO_DH */
# ifndef OPENSSL_NO_EC
{
/*
* TODO(3.0): When provider based EC key gen is present we can enable
* this code.
*/
if (gtype == TLS_GROUP_CURVE_CUSTOM)
pctx = EVP_PKEY_CTX_new_id(ginf->nid, NULL);
else
# if 0
pctx = EVP_PKEY_CTX_new_from_name(s->ctx->libctx, "EC",
s->ctx->propq);
# else
pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL);
# endif
}
# endif
# endif /* OPENSSL_NO_EC */
if (pctx == NULL) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL_GENERATE_PKEY_GROUP,
ERR_R_MALLOC_FAILURE);
@@ -4854,7 +4889,11 @@ EVP_PKEY *ssl_generate_param_group(SSL *s, uint16_t id)
EVP_PKEY_CTX *pctx = NULL;
EVP_PKEY *pkey = NULL;
const TLS_GROUP_INFO *ginf = tls1_group_id_lookup(id);
#if 0
const char *pkey_ctx_name;
#else
int pkey_ctx_id;
#endif
if (ginf == NULL)
goto err;
@@ -4872,9 +4911,16 @@ EVP_PKEY *ssl_generate_param_group(SSL *s, uint16_t id)
* s->ctx->libctx and s->ctx->propq when paramgen has been updated to be
* provider aware.
*/
#if 0
pkey_ctx_name = (ginf->flags & TLS_GROUP_FFDHE) != 0 ? "DH" : "EC";
pctx = EVP_PKEY_CTX_new_from_name(s->ctx->libctx, pkey_ctx_name,
s->ctx->propq);
#else
pkey_ctx_id = (ginf->flags & TLS_GROUP_FFDHE)
? EVP_PKEY_DH : EVP_PKEY_EC;
pctx = EVP_PKEY_CTX_new_id(pkey_ctx_id, NULL);
#endif
if (pctx == NULL)
goto err;
if (EVP_PKEY_paramgen_init(pctx) <= 0)