Latest update.
This commit is contained in:
@@ -70,8 +70,8 @@ struct evp_pkey_asn1_method_st {
|
||||
*/
|
||||
/* Exports to providers */
|
||||
size_t (*dirty_cnt) (const EVP_PKEY *pk);
|
||||
void *(*export_to) (const EVP_PKEY *pk, EVP_KEYMGMT *keymgmt,
|
||||
int want_domainparams);
|
||||
int (*export_to) (const EVP_PKEY *pk, void *to_keydata,
|
||||
EVP_KEYMGMT *to_keymgmt);
|
||||
} /* EVP_PKEY_ASN1_METHOD */ ;
|
||||
|
||||
DEFINE_STACK_OF_CONST(EVP_PKEY_ASN1_METHOD)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 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
|
||||
@@ -22,3 +22,10 @@ extern const BIGNUM _bignum_ffdhe4096_p;
|
||||
extern const BIGNUM _bignum_ffdhe6144_p;
|
||||
extern const BIGNUM _bignum_ffdhe8192_p;
|
||||
extern const BIGNUM _bignum_const_2;
|
||||
|
||||
extern const BIGNUM _bignum_modp_1536_p;
|
||||
extern const BIGNUM _bignum_modp_2048_p;
|
||||
extern const BIGNUM _bignum_modp_3072_p;
|
||||
extern const BIGNUM _bignum_modp_4096_p;
|
||||
extern const BIGNUM _bignum_modp_6144_p;
|
||||
extern const BIGNUM _bignum_modp_8192_p;
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright 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
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#include <openssl/dh.h>
|
||||
#include "internal/ffc.h"
|
||||
|
||||
int dh_generate_ffc_parameters(OPENSSL_CTX *libctx, DH *dh, int bits,
|
||||
int qbits, int gindex, BN_GENCB *cb);
|
||||
|
||||
int dh_compute_key(OPENSSL_CTX *ctx, unsigned char *key, const BIGNUM *pub_key,
|
||||
DH *dh);
|
||||
int dh_compute_key_padded(OPENSSL_CTX *ctx, unsigned char *key,
|
||||
const BIGNUM *pub_key, DH *dh);
|
||||
FFC_PARAMS *dh_get0_params(DH *dh);
|
||||
int dh_get0_nid(const DH *dh);
|
||||
@@ -9,5 +9,19 @@
|
||||
|
||||
#include <openssl/dsa.h>
|
||||
|
||||
#define DSA_PARAMGEN_TYPE_FIPS_186_2 1 /* Use legacy FIPS186-2 standard */
|
||||
#define DSA_PARAMGEN_TYPE_FIPS_186_4 2 /* Use FIPS186-4 standard */
|
||||
|
||||
int dsa_generate_parameters_ctx(OPENSSL_CTX *libctx, DSA *dsa, int bits,
|
||||
const unsigned char *seed_in, int seed_len,
|
||||
int *counter_ret, unsigned long *h_ret,
|
||||
BN_GENCB *cb);
|
||||
|
||||
int dsa_generate_ffc_parameters(OPENSSL_CTX *libctx, DSA *dsa, int type,
|
||||
int pbits, int qbits, int gindex,
|
||||
BN_GENCB *cb);
|
||||
|
||||
int dsa_sign_int(OPENSSL_CTX *libctx, int type, const unsigned char *dgst,
|
||||
int dlen, unsigned char *sig, unsigned int *siglen, DSA *dsa);
|
||||
int dsa_generate_key_ctx(OPENSSL_CTX *libctx, DSA *dsa);
|
||||
const unsigned char *dsa_algorithmidentifier_encoding(int md_nid, size_t *len);
|
||||
+37
-49
@@ -548,17 +548,15 @@ struct evp_pkey_st {
|
||||
|
||||
/* == Provider attributes == */
|
||||
/*
|
||||
* To support transparent export/import between providers that
|
||||
* support the methods for it, and still not having to do the
|
||||
* export/import every time a key or domain params are used, we
|
||||
* maintain a cache of imported key / domain params, indexed by
|
||||
* provider address. pkeys[0] is *always* the "original" data.
|
||||
* To support transparent export/import between providers that support
|
||||
* the methods for it, and still not having to do the export/import
|
||||
* every time a key object is changed, we maintain a cache of imported
|
||||
* key objects, indexed by keymgmt address. pkeys[0] is *always* the
|
||||
* "original" data unless we have a legacy key attached.
|
||||
*/
|
||||
struct {
|
||||
EVP_KEYMGMT *keymgmt;
|
||||
void *provdata;
|
||||
/* 0 = provdata is a key, 1 = provdata is domain params */
|
||||
int domainparams;
|
||||
void *keydata;
|
||||
} pkeys[10];
|
||||
/*
|
||||
* If there is a legacy key assigned to this structure, we keep
|
||||
@@ -566,7 +564,7 @@ struct evp_pkey_st {
|
||||
*/
|
||||
size_t dirty_cnt_copy;
|
||||
|
||||
/* Cache of domain parameter / key information */
|
||||
/* Cache of key object information */
|
||||
struct {
|
||||
int bits;
|
||||
int security_bits;
|
||||
@@ -593,49 +591,39 @@ void openssl_add_all_digests_int(void);
|
||||
void evp_cleanup_int(void);
|
||||
void evp_app_cleanup_int(void);
|
||||
|
||||
/* KEYMGMT helper functions */
|
||||
void *evp_keymgmt_export_to_provider(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt,
|
||||
int domainparams);
|
||||
void evp_keymgmt_clear_pkey_cache(EVP_PKEY *pk);
|
||||
void evp_keymgmt_cache_pkey(EVP_PKEY *pk, size_t index, EVP_KEYMGMT *keymgmt,
|
||||
void *provdata, int domainparams);
|
||||
void *evp_keymgmt_fromdata(EVP_PKEY *target, EVP_KEYMGMT *keymgmt,
|
||||
const OSSL_PARAM params[], int domainparams);
|
||||
/*
|
||||
* KEYMGMT utility functions
|
||||
*/
|
||||
void *evp_keymgmt_util_export_to_provider(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt);
|
||||
void evp_keymgmt_util_clear_pkey_cache(EVP_PKEY *pk);
|
||||
void evp_keymgmt_util_cache_pkey(EVP_PKEY *pk, size_t index,
|
||||
EVP_KEYMGMT *keymgmt, void *keydata);
|
||||
void *evp_keymgmt_util_fromdata(EVP_PKEY *target, EVP_KEYMGMT *keymgmt,
|
||||
int selection, const OSSL_PARAM params[]);
|
||||
|
||||
|
||||
/* KEYMGMT provider interface functions */
|
||||
void *evp_keymgmt_importdomparams(const EVP_KEYMGMT *keymgmt,
|
||||
const OSSL_PARAM params[]);
|
||||
void *evp_keymgmt_gendomparams(const EVP_KEYMGMT *keymgmt,
|
||||
const OSSL_PARAM params[]);
|
||||
void evp_keymgmt_freedomparams(const EVP_KEYMGMT *keymgmt,
|
||||
void *provdomparams);
|
||||
int evp_keymgmt_exportdomparams(const EVP_KEYMGMT *keymgmt,
|
||||
void *provdomparams,
|
||||
OSSL_CALLBACK *param_cb, void *cbarg);
|
||||
const OSSL_PARAM *
|
||||
evp_keymgmt_importdomparam_types(const EVP_KEYMGMT *keymgmt);
|
||||
const OSSL_PARAM *
|
||||
evp_keymgmt_exportdomparam_types(const EVP_KEYMGMT *keymgmt);
|
||||
int evp_keymgmt_get_domparam_params(const EVP_KEYMGMT *keymgmt,
|
||||
void *provdomparam, OSSL_PARAM params[]);
|
||||
const OSSL_PARAM *
|
||||
evp_keymgmt_gettable_domparam_params(const EVP_KEYMGMT *keymgmt);
|
||||
/*
|
||||
* KEYMGMT provider interface functions
|
||||
*/
|
||||
void *evp_keymgmt_newdata(const EVP_KEYMGMT *keymgmt);
|
||||
void evp_keymgmt_freedata(const EVP_KEYMGMT *keymgmt, void *keyddata);
|
||||
int evp_keymgmt_get_params(const EVP_KEYMGMT *keymgmt,
|
||||
void *keydata, OSSL_PARAM params[]);
|
||||
const OSSL_PARAM *evp_keymgmt_gettable_params(const EVP_KEYMGMT *keymgmt);
|
||||
|
||||
void *evp_keymgmt_importkey(const EVP_KEYMGMT *keymgmt,
|
||||
const OSSL_PARAM params[]);
|
||||
void *evp_keymgmt_genkey(const EVP_KEYMGMT *keymgmt, void *domparams,
|
||||
const OSSL_PARAM params[]);
|
||||
void *evp_keymgmt_loadkey(const EVP_KEYMGMT *keymgmt,
|
||||
void *id, size_t idlen);
|
||||
void evp_keymgmt_freekey(const EVP_KEYMGMT *keymgmt, void *provkey);
|
||||
int evp_keymgmt_exportkey(const EVP_KEYMGMT *keymgmt, void *provkey,
|
||||
OSSL_CALLBACK *param_cb, void *cbarg);
|
||||
const OSSL_PARAM *evp_keymgmt_importkey_types(const EVP_KEYMGMT *keymgmt);
|
||||
const OSSL_PARAM *evp_keymgmt_exportkey_types(const EVP_KEYMGMT *keymgmt);
|
||||
int evp_keymgmt_get_key_params(const EVP_KEYMGMT *keymgmt,
|
||||
void *provkey, OSSL_PARAM params[]);
|
||||
const OSSL_PARAM *evp_keymgmt_gettable_key_params(const EVP_KEYMGMT *keymgmt);
|
||||
|
||||
int evp_keymgmt_has(const EVP_KEYMGMT *keymgmt, void *keyddata, int selection);
|
||||
int evp_keymgmt_validate(const EVP_KEYMGMT *keymgmt, void *keydata,
|
||||
int selection);
|
||||
|
||||
int evp_keymgmt_import(const EVP_KEYMGMT *keymgmt, void *keydata,
|
||||
int selection, const OSSL_PARAM params[]);
|
||||
const OSSL_PARAM *evp_keymgmt_import_types(const EVP_KEYMGMT *keymgmt,
|
||||
int selection);
|
||||
int evp_keymgmt_export(const EVP_KEYMGMT *keymgmt, void *keydata,
|
||||
int selection, OSSL_CALLBACK *param_cb, void *cbarg);
|
||||
const OSSL_PARAM *evp_keymgmt_export_types(const EVP_KEYMGMT *keymgmt,
|
||||
int selection);
|
||||
|
||||
/* Pulling defines out of C source files */
|
||||
|
||||
|
||||
@@ -22,4 +22,9 @@ int rsa_get0_all_params(RSA *r, STACK_OF(BIGNUM_const) *primes,
|
||||
int rsa_padding_check_PKCS1_type_2_TLS(unsigned char *to, size_t tlen,
|
||||
const unsigned char *from, size_t flen,
|
||||
int client_version, int alt_version);
|
||||
|
||||
int rsa_validate_public(const RSA *key);
|
||||
int rsa_validate_private(const RSA *key);
|
||||
int rsa_validate_pairwise(const RSA *key);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user