Latest update.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+17
-6
@@ -6,14 +6,14 @@ $COMMON=digest.c evp_enc.c evp_lib.c evp_fetch.c cmeth_lib.c evp_utils.c \
|
||||
|
||||
SOURCE[../../libcrypto]=$COMMON\
|
||||
encode.c evp_key.c evp_cnf.c \
|
||||
e_des.c e_bf.c e_idea.c e_des3.c e_camellia.c\
|
||||
e_rc4.c e_aes.c names.c e_seed.c e_aria.c e_sm4.c \
|
||||
e_des.c e_bf.c e_idea.c e_des3.c \
|
||||
e_rc4.c e_aes.c names.c e_aria.c e_sm4.c \
|
||||
e_xcbc_d.c e_rc2.c e_cast.c e_rc5.c m_null.c \
|
||||
p_open.c p_seal.c p_sign.c p_verify.c \
|
||||
p_seal.c p_sign.c p_verify.c \
|
||||
bio_md.c bio_b64.c bio_enc.c evp_err.c e_null.c \
|
||||
c_allc.c c_alld.c bio_ok.c \
|
||||
evp_pkey.c evp_pbe.c p5_crpt.c p5_crpt2.c pbe_scrypt.c \
|
||||
pkey_kdf.c e_old.c pmeth_fn.c\
|
||||
pkey_kdf.c pmeth_fn.c\
|
||||
e_aes_cbc_hmac_sha1.c e_aes_cbc_hmac_sha256.c e_rc4_hmac_md5.c \
|
||||
e_chacha20_poly1305.c \
|
||||
pkey_mac.c \
|
||||
@@ -22,7 +22,12 @@ SOURCE[../../libcrypto]=$COMMON\
|
||||
IF[{- !$disabled{'deprecated-3.0'} -}]
|
||||
SOURCE[../../libcrypto]=p_enc.c p_dec.c
|
||||
ENDIF
|
||||
|
||||
IF[{- !$disabled{'deprecated-0.9.8'} -}]
|
||||
SOURCE[../../libcrypto]=e_old.c
|
||||
ENDIF
|
||||
IF[{- !$disabled{'rsa'} -}]
|
||||
SOURCE[../../libcrypto]=p_open.c
|
||||
ENDIF
|
||||
IF[{- !$disabled{md2} -}]
|
||||
SOURCE[../../libcrypto]=legacy_md2.c
|
||||
ENDIF
|
||||
@@ -44,6 +49,13 @@ ENDIF
|
||||
IF[{- !$disabled{rmd160} -}]
|
||||
SOURCE[../../libcrypto]=legacy_ripemd.c
|
||||
ENDIF
|
||||
IF[{- !$disabled{seed} -}]
|
||||
SOURCE[../../libcrypto]=e_seed.c
|
||||
ENDIF
|
||||
IF[{- !$disabled{camellia} -}]
|
||||
SOURCE[../../libcrypto]=e_camellia.c
|
||||
INCLUDE[e_camellia.o]=.. ../modes
|
||||
ENDIF
|
||||
|
||||
SOURCE[../../providers/libfips.a]=$COMMON
|
||||
|
||||
@@ -51,7 +63,6 @@ INCLUDE[e_aes.o]=.. ../modes
|
||||
INCLUDE[e_aes_cbc_hmac_sha1.o]=../modes
|
||||
INCLUDE[e_aes_cbc_hmac_sha256.o]=../modes
|
||||
INCLUDE[e_aria.o]=.. ../modes
|
||||
INCLUDE[e_camellia.o]=.. ../modes
|
||||
INCLUDE[e_sm4.o]=.. ../modes
|
||||
INCLUDE[e_des.o]=..
|
||||
INCLUDE[e_des3.o]=..
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2001-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2011-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2013-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+25
-29
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -14,18 +14,15 @@
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
#ifdef OPENSSL_NO_CAMELLIA
|
||||
NON_EMPTY_TRANSLATION_UNIT
|
||||
#else
|
||||
|
||||
# include <openssl/evp.h>
|
||||
# include <openssl/err.h>
|
||||
# include <string.h>
|
||||
# include <assert.h>
|
||||
# include <openssl/camellia.h>
|
||||
# include "crypto/evp.h"
|
||||
# include "crypto/modes.h"
|
||||
# include "crypto/cmll_platform.h"
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/err.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <openssl/camellia.h>
|
||||
#include "crypto/evp.h"
|
||||
#include "crypto/modes.h"
|
||||
#include "crypto/cmll_platform.h"
|
||||
|
||||
static int camellia_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
const unsigned char *iv, int enc);
|
||||
@@ -40,15 +37,15 @@ typedef struct {
|
||||
} stream;
|
||||
} EVP_CAMELLIA_KEY;
|
||||
|
||||
# define MAXBITCHUNK ((size_t)1<<(sizeof(size_t)*8-4))
|
||||
#define MAXBITCHUNK ((size_t)1<<(sizeof(size_t)*8-4))
|
||||
|
||||
/* Attribute operation for Camellia */
|
||||
# define data(ctx) EVP_C_DATA(EVP_CAMELLIA_KEY,ctx)
|
||||
#define data(ctx) EVP_C_DATA(EVP_CAMELLIA_KEY,ctx)
|
||||
|
||||
# if defined(AES_ASM) && (defined(__sparc) || defined(__sparc__))
|
||||
#if defined(AES_ASM) && (defined(__sparc) || defined(__sparc__))
|
||||
/* ---------^^^ this is not a typo, just a way to detect that
|
||||
* assembler support was in general requested... */
|
||||
# include "sparc_arch.h"
|
||||
# include "sparc_arch.h"
|
||||
|
||||
|
||||
static int cmll_t4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
@@ -114,35 +111,35 @@ static int cmll_t4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
return 1;
|
||||
}
|
||||
|
||||
# define cmll_t4_cbc_cipher camellia_cbc_cipher
|
||||
# define cmll_t4_cbc_cipher camellia_cbc_cipher
|
||||
static int cmll_t4_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
const unsigned char *in, size_t len);
|
||||
|
||||
# define cmll_t4_ecb_cipher camellia_ecb_cipher
|
||||
# define cmll_t4_ecb_cipher camellia_ecb_cipher
|
||||
static int cmll_t4_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
const unsigned char *in, size_t len);
|
||||
|
||||
# define cmll_t4_ofb_cipher camellia_ofb_cipher
|
||||
# define cmll_t4_ofb_cipher camellia_ofb_cipher
|
||||
static int cmll_t4_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
const unsigned char *in, size_t len);
|
||||
|
||||
# define cmll_t4_cfb_cipher camellia_cfb_cipher
|
||||
# define cmll_t4_cfb_cipher camellia_cfb_cipher
|
||||
static int cmll_t4_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
const unsigned char *in, size_t len);
|
||||
|
||||
# define cmll_t4_cfb8_cipher camellia_cfb8_cipher
|
||||
# define cmll_t4_cfb8_cipher camellia_cfb8_cipher
|
||||
static int cmll_t4_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
const unsigned char *in, size_t len);
|
||||
|
||||
# define cmll_t4_cfb1_cipher camellia_cfb1_cipher
|
||||
# define cmll_t4_cfb1_cipher camellia_cfb1_cipher
|
||||
static int cmll_t4_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
const unsigned char *in, size_t len);
|
||||
|
||||
# define cmll_t4_ctr_cipher camellia_ctr_cipher
|
||||
# define cmll_t4_ctr_cipher camellia_ctr_cipher
|
||||
static int cmll_t4_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
const unsigned char *in, size_t len);
|
||||
|
||||
# define BLOCK_CIPHER_generic(nid,keylen,blocksize,ivlen,nmode,mode,MODE,flags) \
|
||||
# define BLOCK_CIPHER_generic(nid,keylen,blocksize,ivlen,nmode,mode,MODE,flags) \
|
||||
static const EVP_CIPHER cmll_t4_##keylen##_##mode = { \
|
||||
nid##_##keylen##_##nmode,blocksize,keylen/8,ivlen, \
|
||||
flags|EVP_CIPH_##MODE##_MODE, \
|
||||
@@ -163,9 +160,9 @@ static const EVP_CIPHER camellia_##keylen##_##mode = { \
|
||||
const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
|
||||
{ return SPARC_CMLL_CAPABLE?&cmll_t4_##keylen##_##mode:&camellia_##keylen##_##mode; }
|
||||
|
||||
# else
|
||||
#else
|
||||
|
||||
# define BLOCK_CIPHER_generic(nid,keylen,blocksize,ivlen,nmode,mode,MODE,flags) \
|
||||
# define BLOCK_CIPHER_generic(nid,keylen,blocksize,ivlen,nmode,mode,MODE,flags) \
|
||||
static const EVP_CIPHER camellia_##keylen##_##mode = { \
|
||||
nid##_##keylen##_##nmode,blocksize,keylen/8,ivlen, \
|
||||
flags|EVP_CIPH_##MODE##_MODE, \
|
||||
@@ -177,9 +174,9 @@ static const EVP_CIPHER camellia_##keylen##_##mode = { \
|
||||
const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
|
||||
{ return &camellia_##keylen##_##mode; }
|
||||
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# define BLOCK_CIPHER_generic_pack(nid,keylen,flags) \
|
||||
#define BLOCK_CIPHER_generic_pack(nid,keylen,flags) \
|
||||
BLOCK_CIPHER_generic(nid,keylen,16,16,cbc,cbc,CBC,flags|EVP_CIPH_FLAG_DEFAULT_ASN1) \
|
||||
BLOCK_CIPHER_generic(nid,keylen,16,0,ecb,ecb,ECB,flags|EVP_CIPH_FLAG_DEFAULT_ASN1) \
|
||||
BLOCK_CIPHER_generic(nid,keylen,1,16,ofb128,ofb,OFB,flags|EVP_CIPH_FLAG_DEFAULT_ASN1) \
|
||||
@@ -342,4 +339,3 @@ static int camellia_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
BLOCK_CIPHER_generic_pack(NID_camellia, 128, 0)
|
||||
BLOCK_CIPHER_generic_pack(NID_camellia, 192, 0)
|
||||
BLOCK_CIPHER_generic_pack(NID_camellia, 256, 0)
|
||||
#endif
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+25
-30
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2004-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -8,11 +8,8 @@
|
||||
*/
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
#ifdef OPENSSL_NO_DEPRECATED_0_9_8
|
||||
NON_EMPTY_TRANSLATION_UNIT
|
||||
#else
|
||||
|
||||
# include <openssl/evp.h>
|
||||
#include <openssl/evp.h>
|
||||
|
||||
/*
|
||||
* Define some deprecated functions, so older programs don't crash and burn
|
||||
@@ -21,93 +18,91 @@ NON_EMPTY_TRANSLATION_UNIT
|
||||
* location, not by name.
|
||||
*/
|
||||
|
||||
# ifndef OPENSSL_NO_BF
|
||||
# undef EVP_bf_cfb
|
||||
#ifndef OPENSSL_NO_BF
|
||||
# undef EVP_bf_cfb
|
||||
const EVP_CIPHER *EVP_bf_cfb(void);
|
||||
const EVP_CIPHER *EVP_bf_cfb(void)
|
||||
{
|
||||
return EVP_bf_cfb64();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# ifndef OPENSSL_NO_DES
|
||||
# undef EVP_des_cfb
|
||||
#ifndef OPENSSL_NO_DES
|
||||
# undef EVP_des_cfb
|
||||
const EVP_CIPHER *EVP_des_cfb(void);
|
||||
const EVP_CIPHER *EVP_des_cfb(void)
|
||||
{
|
||||
return EVP_des_cfb64();
|
||||
}
|
||||
|
||||
# undef EVP_des_ede3_cfb
|
||||
# undef EVP_des_ede3_cfb
|
||||
const EVP_CIPHER *EVP_des_ede3_cfb(void);
|
||||
const EVP_CIPHER *EVP_des_ede3_cfb(void)
|
||||
{
|
||||
return EVP_des_ede3_cfb64();
|
||||
}
|
||||
|
||||
# undef EVP_des_ede_cfb
|
||||
# undef EVP_des_ede_cfb
|
||||
const EVP_CIPHER *EVP_des_ede_cfb(void);
|
||||
const EVP_CIPHER *EVP_des_ede_cfb(void)
|
||||
{
|
||||
return EVP_des_ede_cfb64();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# ifndef OPENSSL_NO_IDEA
|
||||
# undef EVP_idea_cfb
|
||||
#ifndef OPENSSL_NO_IDEA
|
||||
# undef EVP_idea_cfb
|
||||
const EVP_CIPHER *EVP_idea_cfb(void);
|
||||
const EVP_CIPHER *EVP_idea_cfb(void)
|
||||
{
|
||||
return EVP_idea_cfb64();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# ifndef OPENSSL_NO_RC2
|
||||
# undef EVP_rc2_cfb
|
||||
#ifndef OPENSSL_NO_RC2
|
||||
# undef EVP_rc2_cfb
|
||||
const EVP_CIPHER *EVP_rc2_cfb(void);
|
||||
const EVP_CIPHER *EVP_rc2_cfb(void)
|
||||
{
|
||||
return EVP_rc2_cfb64();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# ifndef OPENSSL_NO_CAST
|
||||
# undef EVP_cast5_cfb
|
||||
#ifndef OPENSSL_NO_CAST
|
||||
# undef EVP_cast5_cfb
|
||||
const EVP_CIPHER *EVP_cast5_cfb(void);
|
||||
const EVP_CIPHER *EVP_cast5_cfb(void)
|
||||
{
|
||||
return EVP_cast5_cfb64();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# ifndef OPENSSL_NO_RC5
|
||||
# undef EVP_rc5_32_12_16_cfb
|
||||
#ifndef OPENSSL_NO_RC5
|
||||
# undef EVP_rc5_32_12_16_cfb
|
||||
const EVP_CIPHER *EVP_rc5_32_12_16_cfb(void);
|
||||
const EVP_CIPHER *EVP_rc5_32_12_16_cfb(void)
|
||||
{
|
||||
return EVP_rc5_32_12_16_cfb64();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# undef EVP_aes_128_cfb
|
||||
#undef EVP_aes_128_cfb
|
||||
const EVP_CIPHER *EVP_aes_128_cfb(void);
|
||||
const EVP_CIPHER *EVP_aes_128_cfb(void)
|
||||
{
|
||||
return EVP_aes_128_cfb128();
|
||||
}
|
||||
|
||||
# undef EVP_aes_192_cfb
|
||||
#undef EVP_aes_192_cfb
|
||||
const EVP_CIPHER *EVP_aes_192_cfb(void);
|
||||
const EVP_CIPHER *EVP_aes_192_cfb(void)
|
||||
{
|
||||
return EVP_aes_192_cfb128();
|
||||
}
|
||||
|
||||
# undef EVP_aes_256_cfb
|
||||
#undef EVP_aes_256_cfb
|
||||
const EVP_CIPHER *EVP_aes_256_cfb(void);
|
||||
const EVP_CIPHER *EVP_aes_256_cfb(void)
|
||||
{
|
||||
return EVP_aes_256_cfb128();
|
||||
}
|
||||
|
||||
#endif
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2011-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+7
-12
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -14,15 +14,12 @@
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
#ifdef OPENSSL_NO_SEED
|
||||
NON_EMPTY_TRANSLATION_UNIT
|
||||
#else
|
||||
# include <openssl/evp.h>
|
||||
# include <openssl/err.h>
|
||||
# include <string.h>
|
||||
# include <assert.h>
|
||||
# include <openssl/seed.h>
|
||||
# include "crypto/evp.h"
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/err.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <openssl/seed.h>
|
||||
#include "crypto/evp.h"
|
||||
|
||||
static int seed_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
const unsigned char *iv, int enc);
|
||||
@@ -41,5 +38,3 @@ static int seed_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
SEED_set_key(key, &EVP_C_DATA(EVP_SEED_KEY,ctx)->ks);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
#include <openssl/x509v3.h>
|
||||
#include <openssl/trace.h>
|
||||
|
||||
DEFINE_STACK_OF(CONF_VALUE)
|
||||
|
||||
/* Algorithm configuration module. */
|
||||
|
||||
/* TODO(3.0): the config module functions should be passed a library context */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+10
-10
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -73,8 +73,8 @@ static OSSL_METHOD_STORE *get_evp_method_store(OPENSSL_CTX *libctx)
|
||||
}
|
||||
|
||||
/*
|
||||
* To identity the method in the EVP method store, we mix the name identity
|
||||
* with the operation identity, with the assumption that we don't have more
|
||||
* To identify the method in the EVP method store, we mix the name identity
|
||||
* with the operation identity, under the assumption that we don't have more
|
||||
* than 2^24 names or more than 2^8 operation types.
|
||||
*
|
||||
* The resulting identity is a 32-bit integer, composed like this:
|
||||
@@ -83,10 +83,10 @@ static OSSL_METHOD_STORE *get_evp_method_store(OPENSSL_CTX *libctx)
|
||||
* | name identity | op id |
|
||||
* +------------------------+--------+
|
||||
*/
|
||||
static uint32_t evp_method_id(unsigned int operation_id, int name_id)
|
||||
static uint32_t evp_method_id(int name_id, unsigned int operation_id)
|
||||
{
|
||||
if (!ossl_assert(name_id < (1 << 24) || operation_id < (1 << 8))
|
||||
|| !ossl_assert(name_id > 0 && operation_id > 0))
|
||||
if (!ossl_assert(name_id > 0 && name_id < (1 << 24))
|
||||
|| !ossl_assert(operation_id > 0 && operation_id < (1 << 8)))
|
||||
return 0;
|
||||
return ((name_id << 8) & 0xFFFFFF00) | (operation_id & 0x000000FF);
|
||||
}
|
||||
@@ -116,7 +116,7 @@ static void *get_evp_method_from_store(OPENSSL_CTX *libctx, void *store,
|
||||
}
|
||||
|
||||
if (name_id == 0
|
||||
|| (meth_id = evp_method_id(methdata->operation_id, name_id)) == 0)
|
||||
|| (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0)
|
||||
return NULL;
|
||||
|
||||
if (store == NULL
|
||||
@@ -154,7 +154,7 @@ static int put_evp_method_in_store(OPENSSL_CTX *libctx, void *store,
|
||||
|
||||
if ((namemap = ossl_namemap_stored(libctx)) == NULL
|
||||
|| (name_id = ossl_namemap_name2num_n(namemap, names, l)) == 0
|
||||
|| (meth_id = evp_method_id(operation_id, name_id)) == 0)
|
||||
|| (meth_id = evp_method_id(name_id, operation_id)) == 0)
|
||||
return 0;
|
||||
|
||||
if (store == NULL
|
||||
@@ -242,7 +242,7 @@ inner_evp_generic_fetch(OPENSSL_CTX *libctx, int operation_id,
|
||||
* about 2^8) or too many names (more than about 2^24). In that case,
|
||||
* we can't create any new method.
|
||||
*/
|
||||
if (name_id != 0 && (meth_id = evp_method_id(operation_id, name_id)) == 0)
|
||||
if (name_id != 0 && (meth_id = evp_method_id(name_id, operation_id)) == 0)
|
||||
return NULL;
|
||||
|
||||
if (meth_id == 0
|
||||
@@ -277,7 +277,7 @@ inner_evp_generic_fetch(OPENSSL_CTX *libctx, int operation_id,
|
||||
*/
|
||||
if (name_id == 0)
|
||||
name_id = ossl_namemap_name2num(namemap, name);
|
||||
meth_id = evp_method_id(operation_id, name_id);
|
||||
meth_id = evp_method_id(name_id, operation_id);
|
||||
ossl_method_store_cache_set(store, meth_id, properties, method,
|
||||
up_ref_method, free_method);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -76,13 +76,15 @@ int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
|
||||
goto err;
|
||||
|
||||
/* ... but, we should get a return size too! */
|
||||
if (params[0].return_size != 0
|
||||
if (OSSL_PARAM_modified(params)
|
||||
&& params[0].return_size != 0
|
||||
&& (der = OPENSSL_malloc(params[0].return_size)) != NULL) {
|
||||
params[0].data = der;
|
||||
params[0].data_size = params[0].return_size;
|
||||
params[0].return_size = 0;
|
||||
OSSL_PARAM_set_all_unmodified(params);
|
||||
derp = der;
|
||||
if (EVP_CIPHER_CTX_get_params(c, params)
|
||||
&& OSSL_PARAM_modified(params)
|
||||
&& d2i_ASN1_TYPE(&type, (const unsigned char **)&derp,
|
||||
params[0].return_size) != NULL) {
|
||||
ret = 1;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+18
-7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -18,7 +18,8 @@
|
||||
|
||||
/* Extract a private key from a PKCS8 structure */
|
||||
|
||||
EVP_PKEY *EVP_PKCS82PKEY(const PKCS8_PRIV_KEY_INFO *p8)
|
||||
EVP_PKEY *evp_pkcs82pkey_int(const PKCS8_PRIV_KEY_INFO *p8, OPENSSL_CTX *libctx,
|
||||
const char *propq)
|
||||
{
|
||||
EVP_PKEY *pkey = NULL;
|
||||
const ASN1_OBJECT *algoid;
|
||||
@@ -28,24 +29,29 @@ EVP_PKEY *EVP_PKCS82PKEY(const PKCS8_PRIV_KEY_INFO *p8)
|
||||
return NULL;
|
||||
|
||||
if ((pkey = EVP_PKEY_new()) == NULL) {
|
||||
EVPerr(EVP_F_EVP_PKCS82PKEY, ERR_R_MALLOC_FAILURE);
|
||||
EVPerr(0, ERR_R_MALLOC_FAILURE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!EVP_PKEY_set_type(pkey, OBJ_obj2nid(algoid))) {
|
||||
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM);
|
||||
EVPerr(0, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM);
|
||||
i2t_ASN1_OBJECT(obj_tmp, 80, algoid);
|
||||
ERR_add_error_data(2, "TYPE=", obj_tmp);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (pkey->ameth->priv_decode) {
|
||||
if (pkey->ameth->priv_decode_with_libctx != NULL) {
|
||||
if (!pkey->ameth->priv_decode_with_libctx(pkey, p8, libctx, propq)) {
|
||||
EVPerr(0, EVP_R_PRIVATE_KEY_DECODE_ERROR);
|
||||
goto error;
|
||||
}
|
||||
} else if (pkey->ameth->priv_decode != NULL) {
|
||||
if (!pkey->ameth->priv_decode(pkey, p8)) {
|
||||
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_PRIVATE_KEY_DECODE_ERROR);
|
||||
EVPerr(0, EVP_R_PRIVATE_KEY_DECODE_ERROR);
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_METHOD_NOT_SUPPORTED);
|
||||
EVPerr(0, EVP_R_METHOD_NOT_SUPPORTED);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -56,6 +62,11 @@ EVP_PKEY *EVP_PKCS82PKEY(const PKCS8_PRIV_KEY_INFO *p8)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EVP_PKEY *EVP_PKCS82PKEY(const PKCS8_PRIV_KEY_INFO *p8)
|
||||
{
|
||||
return evp_pkcs82pkey_int(p8, NULL, NULL);
|
||||
}
|
||||
|
||||
/* Turn a private key into a PKCS8 structure */
|
||||
|
||||
PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(const EVP_PKEY *pkey)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2018-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2018-2019, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -412,3 +412,49 @@ void *evp_keymgmt_util_gen(EVP_PKEY *target, EVP_KEYMGMT *keymgmt,
|
||||
|
||||
return keydata;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the same numbers as EVP_PKEY_get_default_digest_name()
|
||||
* When the string from the EVP_KEYMGMT implementation is "", we use
|
||||
* SN_undef, since that corresponds to what EVP_PKEY_get_default_nid()
|
||||
* returns for no digest.
|
||||
*/
|
||||
int evp_keymgmt_util_get_deflt_digest_name(EVP_KEYMGMT *keymgmt,
|
||||
void *keydata,
|
||||
char *mdname, size_t mdname_sz)
|
||||
{
|
||||
OSSL_PARAM params[3];
|
||||
char mddefault[100] = "";
|
||||
char mdmandatory[100] = "";
|
||||
char *result = NULL;
|
||||
int rv = -2;
|
||||
|
||||
params[0] =
|
||||
OSSL_PARAM_construct_utf8_string(OSSL_PKEY_PARAM_DEFAULT_DIGEST,
|
||||
mddefault, sizeof(mddefault));
|
||||
params[1] =
|
||||
OSSL_PARAM_construct_utf8_string(OSSL_PKEY_PARAM_MANDATORY_DIGEST,
|
||||
mdmandatory,
|
||||
sizeof(mdmandatory));
|
||||
params[2] = OSSL_PARAM_construct_end();
|
||||
|
||||
if (!evp_keymgmt_get_params(keymgmt, keydata, params))
|
||||
return 0;
|
||||
|
||||
if (OSSL_PARAM_modified(params + 1)) {
|
||||
if (params[1].return_size <= 1) /* Only a NUL byte */
|
||||
result = SN_undef;
|
||||
else
|
||||
result = mdmandatory;
|
||||
rv = 2;
|
||||
} else if (OSSL_PARAM_modified(params)) {
|
||||
if (params[0].return_size <= 1) /* Only a NUL byte */
|
||||
result = SN_undef;
|
||||
else
|
||||
result = mddefault;
|
||||
rv = 1;
|
||||
}
|
||||
if (rv > 0)
|
||||
OPENSSL_strlcpy(mdname, result, mdname_sz);
|
||||
return rv;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -313,8 +313,15 @@ void *evp_keymgmt_gen_init(const EVP_KEYMGMT *keymgmt, int selection)
|
||||
int evp_keymgmt_gen_set_template(const EVP_KEYMGMT *keymgmt, void *genctx,
|
||||
void *template)
|
||||
{
|
||||
/*
|
||||
* It's arguable if we actually should return success in this case, as
|
||||
* it allows the caller to set a template key, which is then ignored.
|
||||
* However, this is how the legacy methods (EVP_PKEY_METHOD) operate,
|
||||
* so we do this in the interest of backward compatibility.
|
||||
* TODO(3.0) Investigate if we should change this behaviour.
|
||||
*/
|
||||
if (keymgmt->gen_set_template == NULL)
|
||||
return 0;
|
||||
return 1;
|
||||
return keymgmt->gen_set_template(genctx, template);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2005-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+11
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -152,10 +152,16 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
|
||||
if (mdname == NULL)
|
||||
mdname = canon_mdname(EVP_MD_name(type));
|
||||
} else {
|
||||
if (mdname == NULL
|
||||
&& EVP_PKEY_get_default_digest_name(locpctx->pkey, locmdname,
|
||||
sizeof(locmdname)))
|
||||
mdname = canon_mdname(locmdname);
|
||||
if (mdname == NULL) {
|
||||
if (evp_keymgmt_util_get_deflt_digest_name(tmp_keymgmt, provkey,
|
||||
locmdname,
|
||||
sizeof(locmdname)) > 0) {
|
||||
mdname = canon_mdname(locmdname);
|
||||
} else {
|
||||
EVPerr(EVP_F_DO_SIGVER_INIT, EVP_R_NO_DEFAULT_DIGEST);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (mdname != NULL) {
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
+54
-84
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "internal/evp.h"
|
||||
#include "internal/provider.h"
|
||||
#include "evp_local.h"
|
||||
DEFINE_STACK_OF(X509_ATTRIBUTE)
|
||||
|
||||
#include "crypto/ec.h"
|
||||
|
||||
@@ -627,14 +628,6 @@ RSA *EVP_PKEY_get1_RSA(EVP_PKEY *pkey)
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_NO_DSA
|
||||
int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key)
|
||||
{
|
||||
int ret = EVP_PKEY_assign_DSA(pkey, key);
|
||||
if (ret)
|
||||
DSA_up_ref(key);
|
||||
return ret;
|
||||
}
|
||||
|
||||
DSA *EVP_PKEY_get0_DSA(const EVP_PKEY *pkey)
|
||||
{
|
||||
if (!evp_pkey_downgrade((EVP_PKEY *)pkey)) {
|
||||
@@ -648,6 +641,13 @@ DSA *EVP_PKEY_get0_DSA(const EVP_PKEY *pkey)
|
||||
return pkey->pkey.dsa;
|
||||
}
|
||||
|
||||
int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key)
|
||||
{
|
||||
int ret = EVP_PKEY_assign_DSA(pkey, key);
|
||||
if (ret)
|
||||
DSA_up_ref(key);
|
||||
return ret;
|
||||
}
|
||||
DSA *EVP_PKEY_get1_DSA(EVP_PKEY *pkey)
|
||||
{
|
||||
DSA *ret = EVP_PKEY_get0_DSA(pkey);
|
||||
@@ -655,10 +655,11 @@ DSA *EVP_PKEY_get1_DSA(EVP_PKEY *pkey)
|
||||
DSA_up_ref(ret);
|
||||
return ret;
|
||||
}
|
||||
# endif
|
||||
# endif /* OPENSSL_NO_DSA */
|
||||
#endif /* FIPS_MODE */
|
||||
|
||||
#ifndef FIPS_MODE
|
||||
# ifndef OPENSSL_NO_EC
|
||||
|
||||
int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, EC_KEY *key)
|
||||
{
|
||||
int ret = EVP_PKEY_assign_EC_KEY(pkey, key);
|
||||
@@ -1007,28 +1008,10 @@ int EVP_PKEY_get_default_digest_nid(EVP_PKEY *pkey, int *pnid)
|
||||
int EVP_PKEY_get_default_digest_name(EVP_PKEY *pkey,
|
||||
char *mdname, size_t mdname_sz)
|
||||
{
|
||||
if (pkey->ameth == NULL) {
|
||||
OSSL_PARAM params[3];
|
||||
char mddefault[100] = "";
|
||||
char mdmandatory[100] = "";
|
||||
|
||||
params[0] =
|
||||
OSSL_PARAM_construct_utf8_string(OSSL_PKEY_PARAM_DEFAULT_DIGEST,
|
||||
mddefault, sizeof(mddefault));
|
||||
params[1] =
|
||||
OSSL_PARAM_construct_utf8_string(OSSL_PKEY_PARAM_MANDATORY_DIGEST,
|
||||
mdmandatory,
|
||||
sizeof(mdmandatory));
|
||||
params[2] = OSSL_PARAM_construct_end();
|
||||
if (!evp_keymgmt_get_params(pkey->keymgmt, pkey->keydata, params))
|
||||
return 0;
|
||||
if (mdmandatory[0] != '\0') {
|
||||
OPENSSL_strlcpy(mdname, mdmandatory, mdname_sz);
|
||||
return 2;
|
||||
}
|
||||
OPENSSL_strlcpy(mdname, mddefault, mdname_sz);
|
||||
return 1;
|
||||
}
|
||||
if (pkey->ameth == NULL)
|
||||
return evp_keymgmt_util_get_deflt_digest_name(pkey->keymgmt,
|
||||
pkey->keydata,
|
||||
mdname, mdname_sz);
|
||||
|
||||
{
|
||||
int nid = NID_undef;
|
||||
@@ -1568,24 +1551,38 @@ int evp_pkey_downgrade(EVP_PKEY *pk)
|
||||
if (pk->ameth->import_from == NULL) {
|
||||
ERR_raise_data(ERR_LIB_EVP, EVP_R_NO_IMPORT_FUNCTION,
|
||||
"key type = %s", keytype);
|
||||
} else if (evp_keymgmt_export(keymgmt, keydata,
|
||||
OSSL_KEYMGMT_SELECT_ALL,
|
||||
pk->ameth->import_from, pk)) {
|
||||
} else {
|
||||
/*
|
||||
* Save the provider side data in the operation cache, so they'll
|
||||
* find it again. evp_pkey_free_it() cleared the cache, so it's
|
||||
* safe to assume slot zero is free.
|
||||
* Note that evp_keymgmt_util_cache_keydata() increments keymgmt's
|
||||
* reference count.
|
||||
* We perform the export in the same libctx as the keymgmt that we
|
||||
* are using.
|
||||
*/
|
||||
evp_keymgmt_util_cache_keydata(pk, 0, keymgmt, keydata);
|
||||
OPENSSL_CTX *libctx = ossl_provider_library_context(keymgmt->prov);
|
||||
EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_from_pkey(libctx, pk, NULL);
|
||||
if (pctx == NULL)
|
||||
ERR_raise(ERR_LIB_EVP, ERR_R_MALLOC_FAILURE);
|
||||
|
||||
/* Synchronize the dirty count */
|
||||
pk->dirty_cnt_copy = pk->ameth->dirty_cnt(pk);
|
||||
if (pctx != NULL
|
||||
&& evp_keymgmt_export(keymgmt, keydata,
|
||||
OSSL_KEYMGMT_SELECT_ALL,
|
||||
pk->ameth->import_from, pctx)) {
|
||||
/*
|
||||
* Save the provider side data in the operation cache, so they'll
|
||||
* find it again. evp_pkey_free_it() cleared the cache, so it's
|
||||
* safe to assume slot zero is free.
|
||||
* Note that evp_keymgmt_util_cache_keydata() increments keymgmt's
|
||||
* reference count.
|
||||
*/
|
||||
evp_keymgmt_util_cache_keydata(pk, 0, keymgmt, keydata);
|
||||
EVP_PKEY_CTX_free(pctx);
|
||||
|
||||
/* evp_keymgmt_export() increased the refcount... */
|
||||
EVP_KEYMGMT_free(keymgmt);
|
||||
return 1;
|
||||
/* Synchronize the dirty count */
|
||||
pk->dirty_cnt_copy = pk->ameth->dirty_cnt(pk);
|
||||
|
||||
/* evp_keymgmt_export() increased the refcount... */
|
||||
EVP_KEYMGMT_free(keymgmt);
|
||||
return 1;
|
||||
}
|
||||
EVP_PKEY_CTX_free(pctx);
|
||||
}
|
||||
|
||||
ERR_raise_data(ERR_LIB_EVP, EVP_R_KEYMGMT_EXPORT_FAILURE,
|
||||
@@ -1620,23 +1617,11 @@ const OSSL_PARAM *EVP_PKEY_gettable_params(EVP_PKEY *pkey)
|
||||
return evp_keymgmt_gettable_params(pkey->keymgmt);
|
||||
}
|
||||
|
||||
/*
|
||||
* For the following methods param->return_size is set to a value
|
||||
* larger than can be returned by the call to evp_keymgmt_get_params().
|
||||
* If it is still this value then the parameter was ignored - and in this
|
||||
* case it returns an error..
|
||||
*/
|
||||
|
||||
int EVP_PKEY_get_bn_param(EVP_PKEY *pkey, const char *key_name, BIGNUM **bn)
|
||||
{
|
||||
int ret = 0;
|
||||
OSSL_PARAM params[2];
|
||||
unsigned char buffer[2048];
|
||||
/*
|
||||
* Use -1 as the terminator here instead of sizeof(buffer) + 1 since
|
||||
* -1 is less likely to be a valid value.
|
||||
*/
|
||||
const size_t not_set = (size_t)-1;
|
||||
unsigned char *buf = NULL;
|
||||
size_t buf_sz = 0;
|
||||
|
||||
@@ -1649,12 +1634,9 @@ int EVP_PKEY_get_bn_param(EVP_PKEY *pkey, const char *key_name, BIGNUM **bn)
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
params[0] = OSSL_PARAM_construct_BN(key_name, buffer, sizeof(buffer));
|
||||
/* If the return_size is still not_set then we know it was not found */
|
||||
params[0].return_size = not_set;
|
||||
params[1] = OSSL_PARAM_construct_end();
|
||||
if (!evp_keymgmt_get_params(pkey->keymgmt, pkey->keydata, params)) {
|
||||
if (params[0].return_size == not_set
|
||||
|| params[0].return_size == 0)
|
||||
if (!OSSL_PARAM_modified(params) || params[0].return_size == 0)
|
||||
return 0;
|
||||
buf_sz = params[0].return_size;
|
||||
/*
|
||||
@@ -1671,7 +1653,7 @@ int EVP_PKEY_get_bn_param(EVP_PKEY *pkey, const char *key_name, BIGNUM **bn)
|
||||
goto err;
|
||||
}
|
||||
/* Fail if the param was not found */
|
||||
if (params[0].return_size == not_set)
|
||||
if (!OSSL_PARAM_modified(params))
|
||||
goto err;
|
||||
ret = OSSL_PARAM_get_BN(params, bn);
|
||||
err:
|
||||
@@ -1684,7 +1666,6 @@ int EVP_PKEY_get_octet_string_param(EVP_PKEY *pkey, const char *key_name,
|
||||
size_t *out_sz)
|
||||
{
|
||||
OSSL_PARAM params[2];
|
||||
const size_t not_set = max_buf_sz + 1;
|
||||
|
||||
if (pkey == NULL
|
||||
|| pkey->keymgmt == NULL
|
||||
@@ -1693,11 +1674,9 @@ int EVP_PKEY_get_octet_string_param(EVP_PKEY *pkey, const char *key_name,
|
||||
return 0;
|
||||
|
||||
params[0] = OSSL_PARAM_construct_octet_string(key_name, buf, max_buf_sz);
|
||||
params[0].return_size = not_set;
|
||||
params[1] = OSSL_PARAM_construct_end();
|
||||
if (!evp_keymgmt_get_params(pkey->keymgmt, pkey->keydata, params))
|
||||
return 0;
|
||||
if (params[0].return_size == not_set)
|
||||
if (!evp_keymgmt_get_params(pkey->keymgmt, pkey->keydata, params)
|
||||
|| !OSSL_PARAM_modified(params))
|
||||
return 0;
|
||||
if (out_sz != NULL)
|
||||
*out_sz = params[0].return_size;
|
||||
@@ -1709,7 +1688,6 @@ int EVP_PKEY_get_utf8_string_param(EVP_PKEY *pkey, const char *key_name,
|
||||
size_t *out_sz)
|
||||
{
|
||||
OSSL_PARAM params[2];
|
||||
const size_t not_set = max_buf_sz + 1;
|
||||
|
||||
if (pkey == NULL
|
||||
|| pkey->keymgmt == NULL
|
||||
@@ -1718,11 +1696,9 @@ int EVP_PKEY_get_utf8_string_param(EVP_PKEY *pkey, const char *key_name,
|
||||
return 0;
|
||||
|
||||
params[0] = OSSL_PARAM_construct_utf8_string(key_name, str, max_buf_sz);
|
||||
params[0].return_size = not_set;
|
||||
params[1] = OSSL_PARAM_construct_end();
|
||||
if (!evp_keymgmt_get_params(pkey->keymgmt, pkey->keydata, params))
|
||||
return 0;
|
||||
if (params[0].return_size == not_set)
|
||||
if (!evp_keymgmt_get_params(pkey->keymgmt, pkey->keydata, params)
|
||||
|| !OSSL_PARAM_modified(params))
|
||||
return 0;
|
||||
if (out_sz != NULL)
|
||||
*out_sz = params[0].return_size;
|
||||
@@ -1732,7 +1708,6 @@ int EVP_PKEY_get_utf8_string_param(EVP_PKEY *pkey, const char *key_name,
|
||||
int EVP_PKEY_get_int_param(EVP_PKEY *pkey, const char *key_name, int *out)
|
||||
{
|
||||
OSSL_PARAM params[2];
|
||||
const size_t not_set = sizeof(int) + 1;
|
||||
|
||||
if (pkey == NULL
|
||||
|| pkey->keymgmt == NULL
|
||||
@@ -1741,11 +1716,9 @@ int EVP_PKEY_get_int_param(EVP_PKEY *pkey, const char *key_name, int *out)
|
||||
return 0;
|
||||
|
||||
params[0] = OSSL_PARAM_construct_int(key_name, out);
|
||||
params[0].return_size = not_set;
|
||||
params[1] = OSSL_PARAM_construct_end();
|
||||
if (!evp_keymgmt_get_params(pkey->keymgmt, pkey->keydata, params))
|
||||
return 0;
|
||||
if (params[0].return_size == not_set)
|
||||
if (!evp_keymgmt_get_params(pkey->keymgmt, pkey->keydata, params)
|
||||
|| !OSSL_PARAM_modified(params))
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
@@ -1753,7 +1726,6 @@ int EVP_PKEY_get_int_param(EVP_PKEY *pkey, const char *key_name, int *out)
|
||||
int EVP_PKEY_get_size_t_param(EVP_PKEY *pkey, const char *key_name, size_t *out)
|
||||
{
|
||||
OSSL_PARAM params[2];
|
||||
const size_t not_set = sizeof(size_t) + 1;
|
||||
|
||||
if (pkey == NULL
|
||||
|| pkey->keymgmt == NULL
|
||||
@@ -1762,11 +1734,9 @@ int EVP_PKEY_get_size_t_param(EVP_PKEY *pkey, const char *key_name, size_t *out)
|
||||
return 0;
|
||||
|
||||
params[0] = OSSL_PARAM_construct_size_t(key_name, out);
|
||||
params[0].return_size = not_set;
|
||||
params[1] = OSSL_PARAM_construct_end();
|
||||
if (!evp_keymgmt_get_params(pkey->keymgmt, pkey->keydata, params))
|
||||
return 0;
|
||||
if (params[0].return_size == not_set)
|
||||
if (!evp_keymgmt_get_params(pkey->keymgmt, pkey->keydata, params)
|
||||
|| !OSSL_PARAM_modified(params))
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
+6
-10
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -8,15 +8,12 @@
|
||||
*/
|
||||
|
||||
#include "internal/cryptlib.h"
|
||||
#ifdef OPENSSL_NO_RSA
|
||||
NON_EMPTY_TRANSLATION_UNIT
|
||||
#else
|
||||
|
||||
# include <stdio.h>
|
||||
# include <openssl/evp.h>
|
||||
# include <openssl/objects.h>
|
||||
# include <openssl/x509.h>
|
||||
# include <openssl/rsa.h>
|
||||
#include <stdio.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/rsa.h>
|
||||
|
||||
int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
|
||||
const unsigned char *ek, int ekl, const unsigned char *iv,
|
||||
@@ -73,4 +70,3 @@ int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
|
||||
i = EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, NULL);
|
||||
return i;
|
||||
}
|
||||
#endif
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -170,8 +170,12 @@ int EVP_PKEY_gen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey)
|
||||
evp_pkey_export_to_provider(ctx->pkey, ctx->libctx,
|
||||
&tmp_keymgmt, ctx->propquery);
|
||||
|
||||
if (keydata == NULL)
|
||||
if (tmp_keymgmt == NULL)
|
||||
goto not_supported;
|
||||
/*
|
||||
* It's ok if keydata is NULL here. The backend is expected to deal
|
||||
* with that as it sees fit.
|
||||
*/
|
||||
ret = evp_keymgmt_gen_set_template(ctx->keymgmt,
|
||||
ctx->op.keymgmt.genctx, keydata);
|
||||
}
|
||||
|
||||
+51
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* DH low level APIs are deprecated for public use, but still ok for
|
||||
* Low level key APIs (DH etc) are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
@@ -24,6 +24,8 @@
|
||||
#include "internal/cryptlib.h"
|
||||
#include "crypto/asn1.h"
|
||||
#include "crypto/evp.h"
|
||||
#include "crypto/dh.h"
|
||||
#include "internal/ffc.h"
|
||||
#include "internal/numbers.h"
|
||||
#include "internal/provider.h"
|
||||
#include "evp_local.h"
|
||||
@@ -234,6 +236,7 @@ static EVP_PKEY_CTX *int_ctx_new(OPENSSL_CTX *libctx,
|
||||
|
||||
ret = OPENSSL_zalloc(sizeof(*ret));
|
||||
if (ret == NULL) {
|
||||
EVP_KEYMGMT_free(keymgmt);
|
||||
#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODE)
|
||||
ENGINE_finish(e);
|
||||
#endif
|
||||
@@ -808,11 +811,34 @@ static int legacy_ctrl_to_param(EVP_PKEY_CTX *ctx, int keytype, int optype,
|
||||
*/
|
||||
if (cmd == EVP_PKEY_CTRL_CIPHER)
|
||||
return -2;
|
||||
|
||||
# ifndef OPENSSL_NO_DH
|
||||
if (keytype == EVP_PKEY_DH) {
|
||||
switch (cmd) {
|
||||
case EVP_PKEY_CTRL_DH_PAD:
|
||||
return EVP_PKEY_CTX_set_dh_pad(ctx, p1);
|
||||
case EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN:
|
||||
return EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, p1);
|
||||
case EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN:
|
||||
return EVP_PKEY_CTX_set_dh_paramgen_subprime_len(ctx, p1);
|
||||
case EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR:
|
||||
return EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, p1);
|
||||
case EVP_PKEY_CTRL_DH_PARAMGEN_TYPE:
|
||||
return EVP_PKEY_CTX_set_dh_paramgen_type(ctx, p1);
|
||||
case EVP_PKEY_CTRL_DH_RFC5114:
|
||||
return EVP_PKEY_CTX_set_dh_rfc5114(ctx, p1);
|
||||
}
|
||||
}
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DSA
|
||||
if (keytype == EVP_PKEY_DSA) {
|
||||
switch (cmd) {
|
||||
case EVP_PKEY_CTRL_DSA_PARAMGEN_BITS:
|
||||
return EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, p1);
|
||||
case EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS:
|
||||
return EVP_PKEY_CTX_set_dsa_paramgen_q_bits(ctx, p1);
|
||||
case EVP_PKEY_CTRL_DSA_PARAMGEN_MD:
|
||||
return EVP_PKEY_CTX_set_dsa_paramgen_md(ctx, p2);
|
||||
}
|
||||
}
|
||||
# endif
|
||||
@@ -1000,8 +1026,30 @@ static int legacy_ctrl_str_to_param(EVP_PKEY_CTX *ctx, const char *name,
|
||||
name = OSSL_PKEY_PARAM_RSA_E;
|
||||
else if (strcmp(name, "rsa_keygen_primes") == 0)
|
||||
name = OSSL_PKEY_PARAM_RSA_PRIMES;
|
||||
# ifndef OPENSSL_NO_DSA
|
||||
else if (strcmp(name, "dsa_paramgen_bits") == 0)
|
||||
name = OSSL_PKEY_PARAM_FFC_PBITS;
|
||||
else if (strcmp(name, "dsa_paramgen_q_bits") == 0)
|
||||
name = OSSL_PKEY_PARAM_FFC_QBITS;
|
||||
else if (strcmp(name, "dsa_paramgen_md") == 0)
|
||||
name = OSSL_PKEY_PARAM_FFC_DIGEST;
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DH
|
||||
else if (strcmp(name, "dh_pad") == 0)
|
||||
else if (strcmp(name, "dh_paramgen_generator") == 0)
|
||||
name = OSSL_PKEY_PARAM_FFC_GENERATOR;
|
||||
else if (strcmp(name, "dh_paramgen_prime_len") == 0)
|
||||
name = OSSL_PKEY_PARAM_FFC_PBITS;
|
||||
else if (strcmp(name, "dh_paramgen_subprime_len") == 0)
|
||||
name = OSSL_PKEY_PARAM_FFC_QBITS;
|
||||
else if (strcmp(name, "dh_paramgen_type") == 0) {
|
||||
name = OSSL_PKEY_PARAM_FFC_TYPE;
|
||||
value = dh_gen_type_id2name(atoi(value));
|
||||
} else if (strcmp(name, "dh_param") == 0)
|
||||
name = OSSL_PKEY_PARAM_FFC_GROUP;
|
||||
else if (strcmp(name, "dh_rfc5114") == 0) {
|
||||
name = OSSL_PKEY_PARAM_FFC_GROUP;
|
||||
value = ffc_named_group_from_uid(atoi(value));
|
||||
} else if (strcmp(name, "dh_pad") == 0)
|
||||
name = OSSL_EXCHANGE_PARAM_PAD;
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_EC
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -369,7 +369,7 @@ static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, int operation)
|
||||
tmp_keymgmt = ctx->keymgmt;
|
||||
provkey = evp_pkey_export_to_provider(ctx->pkey, ctx->libctx,
|
||||
&tmp_keymgmt, ctx->propquery);
|
||||
if (provkey == NULL)
|
||||
if (tmp_keymgmt == NULL)
|
||||
goto legacy;
|
||||
if (!EVP_KEYMGMT_up_ref(tmp_keymgmt)) {
|
||||
ERR_clear_last_mark();
|
||||
|
||||
Reference in New Issue
Block a user