EVP: Make evp_pkey_ctx_state() available to all of EVP
[openssl.git] / include / crypto / evp.h
index 1017ace03d40d4b320f2b9bc1abfe83de14068a7..2a92a1e5331043a762c1682923dcf96e9145a6b5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2021 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
@@ -23,7 +23,7 @@
 #define EVP_MD_CTX_FLAG_KEEP_PKEY_CTX   0x0400
 
 /*
- * An EVP_PKEY can have the following support states:
+ * An EVP_PKEY_CTX can have the following support states:
  *
  * Supports legacy implementations only:
  *
@@ -854,4 +854,14 @@ int evp_set_default_properties_int(OSSL_LIB_CTX *libctx, const char *propq,
 
 void evp_md_ctx_clear_digest(EVP_MD_CTX *ctx, int force);
 
+EVP_PKEY *evp_privatekey_from_binary(int keytype, EVP_PKEY **a,
+                                     const unsigned char **pp, long length,
+                                     OSSL_LIB_CTX *libctx, const char *propq);
+
+/* Three possible states: */
+# define EVP_PKEY_STATE_UNKNOWN         0
+# define EVP_PKEY_STATE_LEGACY          1
+# define EVP_PKEY_STATE_PROVIDER        2
+int evp_pkey_ctx_state(const EVP_PKEY_CTX *ctx);
+
 #endif /* OSSL_CRYPTO_EVP_H */