diff options
author | tb <> | 2022-05-04 18:02:07 +0000 |
---|---|---|
committer | tb <> | 2022-05-04 18:02:07 +0000 |
commit | c2bd2254d2578012c49d4bb5a04b98fc4cc58c91 (patch) | |
tree | c6e51990237a19557e894998433500b8506b75ae /src/lib/libcrypto/kdf/kdf_err.c | |
parent | b993a94817ecfc2be167f26125f89d1fbb004d5f (diff) | |
download | openbsd-c2bd2254d2578012c49d4bb5a04b98fc4cc58c91.tar.gz openbsd-c2bd2254d2578012c49d4bb5a04b98fc4cc58c91.tar.bz2 openbsd-c2bd2254d2578012c49d4bb5a04b98fc4cc58c91.zip |
Import HKDF code from OpenSSL 1.1.1o
This imports verbatim copies as of the OpenSSL_1_1_1o tag of
crypto/kdf/hkdf.c
crypto/kdf/hkdf_err.c
include/openssl/kdf.h
include/openssl/kdferr.h
from https://www.github.com/openssl/openssl.git into lib/libcrypto/kdf.
We only want the EVP interface to HKDF since some ports need them. Not
yet linked to the build since it will not compile. Follow-on commits will
add KNF, clean up and make this compile.
Tests of an early draft version by abieber and Caspar Schutijser
ok jsing
Diffstat (limited to 'src/lib/libcrypto/kdf/kdf_err.c')
-rw-r--r-- | src/lib/libcrypto/kdf/kdf_err.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/lib/libcrypto/kdf/kdf_err.c b/src/lib/libcrypto/kdf/kdf_err.c new file mode 100644 index 0000000000..1627c0a394 --- /dev/null +++ b/src/lib/libcrypto/kdf/kdf_err.c | |||
@@ -0,0 +1,67 @@ | |||
1 | /* | ||
2 | * Generated by util/mkerr.pl DO NOT EDIT | ||
3 | * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. | ||
4 | * | ||
5 | * Licensed under the OpenSSL license (the "License"). You may not use | ||
6 | * this file except in compliance with the License. You can obtain a copy | ||
7 | * in the file LICENSE in the source distribution or at | ||
8 | * https://www.openssl.org/source/license.html | ||
9 | */ | ||
10 | |||
11 | #include <openssl/err.h> | ||
12 | #include <openssl/kdferr.h> | ||
13 | |||
14 | #ifndef OPENSSL_NO_ERR | ||
15 | |||
16 | static const ERR_STRING_DATA KDF_str_functs[] = { | ||
17 | {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_HKDF_CTRL_STR, 0), "pkey_hkdf_ctrl_str"}, | ||
18 | {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_HKDF_DERIVE, 0), "pkey_hkdf_derive"}, | ||
19 | {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_HKDF_INIT, 0), "pkey_hkdf_init"}, | ||
20 | {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_SCRYPT_CTRL_STR, 0), | ||
21 | "pkey_scrypt_ctrl_str"}, | ||
22 | {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_SCRYPT_CTRL_UINT64, 0), | ||
23 | "pkey_scrypt_ctrl_uint64"}, | ||
24 | {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_SCRYPT_DERIVE, 0), "pkey_scrypt_derive"}, | ||
25 | {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_SCRYPT_INIT, 0), "pkey_scrypt_init"}, | ||
26 | {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_SCRYPT_SET_MEMBUF, 0), | ||
27 | "pkey_scrypt_set_membuf"}, | ||
28 | {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_TLS1_PRF_CTRL_STR, 0), | ||
29 | "pkey_tls1_prf_ctrl_str"}, | ||
30 | {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_TLS1_PRF_DERIVE, 0), | ||
31 | "pkey_tls1_prf_derive"}, | ||
32 | {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_TLS1_PRF_INIT, 0), "pkey_tls1_prf_init"}, | ||
33 | {ERR_PACK(ERR_LIB_KDF, KDF_F_TLS1_PRF_ALG, 0), "tls1_prf_alg"}, | ||
34 | {0, NULL} | ||
35 | }; | ||
36 | |||
37 | static const ERR_STRING_DATA KDF_str_reasons[] = { | ||
38 | {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_INVALID_DIGEST), "invalid digest"}, | ||
39 | {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_MISSING_ITERATION_COUNT), | ||
40 | "missing iteration count"}, | ||
41 | {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_MISSING_KEY), "missing key"}, | ||
42 | {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_MISSING_MESSAGE_DIGEST), | ||
43 | "missing message digest"}, | ||
44 | {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_MISSING_PARAMETER), "missing parameter"}, | ||
45 | {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_MISSING_PASS), "missing pass"}, | ||
46 | {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_MISSING_SALT), "missing salt"}, | ||
47 | {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_MISSING_SECRET), "missing secret"}, | ||
48 | {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_MISSING_SEED), "missing seed"}, | ||
49 | {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_UNKNOWN_PARAMETER_TYPE), | ||
50 | "unknown parameter type"}, | ||
51 | {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_VALUE_ERROR), "value error"}, | ||
52 | {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_VALUE_MISSING), "value missing"}, | ||
53 | {0, NULL} | ||
54 | }; | ||
55 | |||
56 | #endif | ||
57 | |||
58 | int ERR_load_KDF_strings(void) | ||
59 | { | ||
60 | #ifndef OPENSSL_NO_ERR | ||
61 | if (ERR_func_error_string(KDF_str_functs[0].error) == NULL) { | ||
62 | ERR_load_strings_const(KDF_str_functs); | ||
63 | ERR_load_strings_const(KDF_str_reasons); | ||
64 | } | ||
65 | #endif | ||
66 | return 1; | ||
67 | } | ||