securitycheck.h 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #include "crypto/types.h"
  10. /* Functions that are common */
  11. int ossl_rsa_check_key(OSSL_LIB_CTX *ctx, const RSA *rsa, int operation);
  12. int ossl_ec_check_key(OSSL_LIB_CTX *ctx, const EC_KEY *ec, int protect);
  13. int ossl_dsa_check_key(OSSL_LIB_CTX *ctx, const DSA *dsa, int sign);
  14. int ossl_dh_check_key(OSSL_LIB_CTX *ctx, const DH *dh);
  15. int ossl_digest_is_allowed(OSSL_LIB_CTX *ctx, const EVP_MD *md);
  16. /* With security check enabled it can return -1 to indicate disallowed md */
  17. int ossl_digest_get_approved_nid_with_sha1(OSSL_LIB_CTX *ctx, const EVP_MD *md,
  18. int sha1_allowed);
  19. /* Functions that are common */
  20. int ossl_digest_md_to_nid(const EVP_MD *md, const OSSL_ITEM *it, size_t it_len);
  21. int ossl_digest_get_approved_nid(const EVP_MD *md);
  22. /* Functions that have different implementations for the FIPS_MODULE */
  23. int ossl_digest_rsa_sign_get_md_nid(OSSL_LIB_CTX *ctx, const EVP_MD *md,
  24. int sha1_allowed);
  25. int ossl_securitycheck_enabled(OSSL_LIB_CTX *libctx);
  26. int ossl_tls1_prf_ems_check_enabled(OSSL_LIB_CTX *libctx);