2020-01-12 09:32:12 +08:00
|
|
|
/*
|
2022-05-03 18:52:38 +08:00
|
|
|
* Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved.
|
2020-01-12 09:32:12 +08:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2021-12-17 18:57:46 +08:00
|
|
|
#ifndef OSSL_CRYPTO_DSA_H
|
|
|
|
# define OSSL_CRYPTO_DSA_H
|
2021-02-07 05:36:46 +08:00
|
|
|
# pragma once
|
|
|
|
|
|
|
|
# include <openssl/core.h>
|
|
|
|
# include <openssl/dsa.h>
|
|
|
|
# include "internal/ffc.h"
|
2020-01-12 09:32:12 +08:00
|
|
|
|
2023-12-09 04:41:51 +08:00
|
|
|
/*
|
|
|
|
* DSA Paramgen types
|
|
|
|
* Note, adding to this list requires adjustments to various checks
|
|
|
|
* in dsa_gen range validation checks
|
|
|
|
*/
|
2020-04-15 19:02:52 +08:00
|
|
|
#define DSA_PARAMGEN_TYPE_FIPS_186_4 0 /* Use FIPS186-4 standard */
|
2020-02-06 20:28:36 +08:00
|
|
|
#define DSA_PARAMGEN_TYPE_FIPS_186_2 1 /* Use legacy FIPS186-2 standard */
|
2021-03-11 11:36:27 +08:00
|
|
|
#define DSA_PARAMGEN_TYPE_FIPS_DEFAULT 2
|
2020-02-06 20:28:36 +08:00
|
|
|
|
Fix external symbols related to dsa keys
Partial fix for #12964
This adds ossl_ names for the following symbols:
dsa_check_pairwise, dsa_check_params, dsa_check_priv_key, dsa_check_pub_key, dsa_check_pub_key_partial,
dsa_do_sign_int, dsa_ffc_params_fromdata,
dsa_generate_ffc_parameters, dsa_generate_public_key,
dsa_get0_params, dsa_key_fromdata, dsa_new_with_ctx, dsa_pkey_method, dsa_sign_int
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14231)
2021-02-18 14:30:37 +08:00
|
|
|
DSA *ossl_dsa_new(OSSL_LIB_CTX *libctx);
|
2020-12-11 18:01:09 +08:00
|
|
|
void ossl_dsa_set0_libctx(DSA *d, OSSL_LIB_CTX *libctx);
|
2020-02-06 20:28:36 +08:00
|
|
|
|
Fix external symbols related to dsa keys
Partial fix for #12964
This adds ossl_ names for the following symbols:
dsa_check_pairwise, dsa_check_params, dsa_check_priv_key, dsa_check_pub_key, dsa_check_pub_key_partial,
dsa_do_sign_int, dsa_ffc_params_fromdata,
dsa_generate_ffc_parameters, dsa_generate_public_key,
dsa_get0_params, dsa_key_fromdata, dsa_new_with_ctx, dsa_pkey_method, dsa_sign_int
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14231)
2021-02-18 14:30:37 +08:00
|
|
|
int ossl_dsa_generate_ffc_parameters(DSA *dsa, int type, int pbits, int qbits,
|
|
|
|
BN_GENCB *cb);
|
2020-02-06 20:28:36 +08:00
|
|
|
|
Fix external symbols related to dsa keys
Partial fix for #12964
This adds ossl_ names for the following symbols:
dsa_check_pairwise, dsa_check_params, dsa_check_priv_key, dsa_check_pub_key, dsa_check_pub_key_partial,
dsa_do_sign_int, dsa_ffc_params_fromdata,
dsa_generate_ffc_parameters, dsa_generate_public_key,
dsa_get0_params, dsa_key_fromdata, dsa_new_with_ctx, dsa_pkey_method, dsa_sign_int
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14231)
2021-02-18 14:30:37 +08:00
|
|
|
int ossl_dsa_sign_int(int type, const unsigned char *dgst, int dlen,
|
2022-07-15 19:22:01 +08:00
|
|
|
unsigned char *sig, unsigned int *siglen, DSA *dsa,
|
|
|
|
unsigned int nonce_type, const char *digestname,
|
|
|
|
OSSL_LIB_CTX *libctx, const char *propq);
|
2020-02-06 16:53:15 +08:00
|
|
|
|
Fix external symbols related to dsa keys
Partial fix for #12964
This adds ossl_ names for the following symbols:
dsa_check_pairwise, dsa_check_params, dsa_check_priv_key, dsa_check_pub_key, dsa_check_pub_key_partial,
dsa_do_sign_int, dsa_ffc_params_fromdata,
dsa_generate_ffc_parameters, dsa_generate_public_key,
dsa_get0_params, dsa_key_fromdata, dsa_new_with_ctx, dsa_pkey_method, dsa_sign_int
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14231)
2021-02-18 14:30:37 +08:00
|
|
|
FFC_PARAMS *ossl_dsa_get0_params(DSA *dsa);
|
|
|
|
int ossl_dsa_ffc_params_fromdata(DSA *dsa, const OSSL_PARAM params[]);
|
2021-12-06 07:27:12 +08:00
|
|
|
int ossl_dsa_key_fromdata(DSA *dsa, const OSSL_PARAM params[],
|
|
|
|
int include_private);
|
2021-03-18 17:41:53 +08:00
|
|
|
DSA *ossl_dsa_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf,
|
|
|
|
OSSL_LIB_CTX *libctx, const char *propq);
|
2020-02-06 16:53:15 +08:00
|
|
|
|
Fix external symbols related to dsa keys
Partial fix for #12964
This adds ossl_ names for the following symbols:
dsa_check_pairwise, dsa_check_params, dsa_check_priv_key, dsa_check_pub_key, dsa_check_pub_key_partial,
dsa_do_sign_int, dsa_ffc_params_fromdata,
dsa_generate_ffc_parameters, dsa_generate_public_key,
dsa_get0_params, dsa_key_fromdata, dsa_new_with_ctx, dsa_pkey_method, dsa_sign_int
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14231)
2021-02-18 14:30:37 +08:00
|
|
|
int ossl_dsa_generate_public_key(BN_CTX *ctx, const DSA *dsa,
|
|
|
|
const BIGNUM *priv_key, BIGNUM *pub_key);
|
|
|
|
int ossl_dsa_check_params(const DSA *dsa, int checktype, int *ret);
|
|
|
|
int ossl_dsa_check_pub_key(const DSA *dsa, const BIGNUM *pub_key, int *ret);
|
|
|
|
int ossl_dsa_check_pub_key_partial(const DSA *dsa, const BIGNUM *pub_key,
|
|
|
|
int *ret);
|
|
|
|
int ossl_dsa_check_priv_key(const DSA *dsa, const BIGNUM *priv_key, int *ret);
|
|
|
|
int ossl_dsa_check_pairwise(const DSA *dsa);
|
2021-04-13 23:31:08 +08:00
|
|
|
int ossl_dsa_is_foreign(const DSA *dsa);
|
2021-04-09 00:25:26 +08:00
|
|
|
DSA *ossl_dsa_dup(const DSA *dsa, int selection);
|
2021-02-07 05:36:46 +08:00
|
|
|
|
|
|
|
#endif
|