diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2019-04-22 17:18:56 +1000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-05-03 17:52:50 +0200 |
commit | d2ba812343a62b1f86a15ae09bdeafec6d82f43a (patch) | |
tree | e37b3953dae069a3ea00ebdd321f68a29761d627 /include | |
parent | e616c11e170ef524b12e218537f4bf290057f8b7 (diff) |
Added EVP_KDF (similiar to the EVP_MAC)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8808)
Diffstat (limited to 'include')
-rw-r--r-- | include/openssl/crypto.h | 2 | ||||
-rw-r--r-- | include/openssl/kdf.h | 7 | ||||
-rw-r--r-- | include/openssl/objects.h | 5 | ||||
-rw-r--r-- | include/openssl/ossl_typ.h | 1 |
4 files changed, 13 insertions, 2 deletions
diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h index 7d9532f24c..3eef3e96fa 100644 --- a/include/openssl/crypto.h +++ b/include/openssl/crypto.h @@ -402,6 +402,8 @@ int CRYPTO_memcmp(const void * in_a, const void * in_b, size_t len); /* FREE: 0x40000000L */ /* FREE: 0x80000000L */ /* Max OPENSSL_INIT flag value is 0x80000000 */ +# define OPENSSL_INIT_NO_ADD_ALL_KDFS 0x100000000L +# define OPENSSL_INIT_ADD_ALL_KDFS 0x200000000L /* openssl and dasync not counted as builtin */ # define OPENSSL_INIT_ENGINE_ALL_BUILTIN \ diff --git a/include/openssl/kdf.h b/include/openssl/kdf.h index 3a14662800..6f38066743 100644 --- a/include/openssl/kdf.h +++ b/include/openssl/kdf.h @@ -26,7 +26,9 @@ extern "C" { # define EVP_KDF_SS NID_sskdf EVP_KDF_CTX *EVP_KDF_CTX_new_id(int id); +EVP_KDF_CTX *EVP_KDF_CTX_new(const EVP_KDF *kdf); void EVP_KDF_CTX_free(EVP_KDF_CTX *ctx); +const EVP_KDF *EVP_KDF_CTX_kdf(EVP_KDF_CTX *ctx); void EVP_KDF_reset(EVP_KDF_CTX *ctx); int EVP_KDF_ctrl(EVP_KDF_CTX *ctx, int cmd, ...); @@ -35,6 +37,11 @@ int EVP_KDF_ctrl_str(EVP_KDF_CTX *ctx, const char *type, const char *value); size_t EVP_KDF_size(EVP_KDF_CTX *ctx); int EVP_KDF_derive(EVP_KDF_CTX *ctx, unsigned char *key, size_t keylen); +int EVP_KDF_nid(const EVP_KDF *kdf); +# define EVP_get_kdfbynid(a) EVP_get_kdfbyname(OBJ_nid2sn(a)) +# define EVP_get_kdfbyobj(a) EVP_get_kdfbynid(OBJ_obj2nid(a)) +# define EVP_KDF_name(o) OBJ_nid2sn(EVP_KDF_nid(o)) +const EVP_KDF *EVP_get_kdfbyname(const char *name); # define EVP_KDF_CTRL_SET_PASS 0x01 /* unsigned char *, size_t */ # define EVP_KDF_CTRL_SET_SALT 0x02 /* unsigned char *, size_t */ diff --git a/include/openssl/objects.h b/include/openssl/objects.h index d077ad4b00..9416df23df 100644 --- a/include/openssl/objects.h +++ b/include/openssl/objects.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 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 @@ -21,7 +21,8 @@ # define OBJ_NAME_TYPE_PKEY_METH 0x03 # define OBJ_NAME_TYPE_COMP_METH 0x04 # define OBJ_NAME_TYPE_MAC_METH 0x05 -# define OBJ_NAME_TYPE_NUM 0x06 +# define OBJ_NAME_TYPE_KDF_METH 0x06 +# define OBJ_NAME_TYPE_NUM 0x07 # define OBJ_NAME_ALIAS 0x8000 diff --git a/include/openssl/ossl_typ.h b/include/openssl/ossl_typ.h index 07e5f02983..202e366213 100644 --- a/include/openssl/ossl_typ.h +++ b/include/openssl/ossl_typ.h @@ -101,6 +101,7 @@ typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD; typedef struct evp_pkey_method_st EVP_PKEY_METHOD; typedef struct evp_pkey_ctx_st EVP_PKEY_CTX; +typedef struct evp_kdf_st EVP_KDF; typedef struct evp_kdf_ctx_st EVP_KDF_CTX; typedef struct evp_Encode_Ctx_st EVP_ENCODE_CTX; |