diff options
Diffstat (limited to 'crypto/include')
-rw-r--r-- | crypto/include/internal/evp_int.h | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/crypto/include/internal/evp_int.h b/crypto/include/internal/evp_int.h index 2b49e68c70..caf0ca1dd9 100644 --- a/crypto/include/internal/evp_int.h +++ b/crypto/include/internal/evp_int.h @@ -18,11 +18,20 @@ #define EVP_MD_CTX_FLAG_KEEP_PKEY_CTX 0x0400 struct evp_pkey_ctx_st { - EVP_KEYEXCH *exchange; - void *exchprovctx; + /* Actual operation */ + int operation; + + union { + struct { + EVP_KEYEXCH *exchange; + void *exchprovctx; + } kex; - EVP_SIGNATURE *signature; - void *sigprovctx; + struct { + EVP_SIGNATURE *signature; + void *sigprovctx; + } sig; + } op; /* Legacy fields below */ @@ -34,8 +43,6 @@ struct evp_pkey_ctx_st { EVP_PKEY *pkey; /* Peer key for key agreement, may be NULL */ EVP_PKEY *peerkey; - /* Actual operation */ - int operation; /* Algorithm specific data */ void *data; /* Application specific data */ @@ -550,6 +557,15 @@ struct evp_pkey_st { size_t dirty_cnt_copy; } /* EVP_PKEY */ ; +#define EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx) \ + ((ctx)->operation == EVP_PKEY_OP_SIGN \ + || (ctx)->operation == EVP_PKEY_OP_SIGNCTX \ + || (ctx)->operation == EVP_PKEY_OP_VERIFY \ + || (ctx)->operation == EVP_PKEY_OP_VERIFYCTX \ + || (ctx)->operation == EVP_PKEY_OP_VERIFYRECOVER) + +#define EVP_PKEY_CTX_IS_DERIVE_OP(ctx) \ + ((ctx)->operation == EVP_PKEY_OP_DERIVE) void openssl_add_all_ciphers_int(void); void openssl_add_all_digests_int(void); |