1*b5501fa0Stb /* $OpenBSD: kdf_err.c,v 1.11 2024/07/09 16:20:17 tb Exp $ */
22630021bStb /* ====================================================================
3566509d7Stb * Copyright (c) 1999-2018 The OpenSSL Project. All rights reserved.
42630021bStb *
52630021bStb * Redistribution and use in source and binary forms, with or without
62630021bStb * modification, are permitted provided that the following conditions
72630021bStb * are met:
82630021bStb *
92630021bStb * 1. Redistributions of source code must retain the above copyright
102630021bStb * notice, this list of conditions and the following disclaimer.
112630021bStb *
122630021bStb * 2. Redistributions in binary form must reproduce the above copyright
132630021bStb * notice, this list of conditions and the following disclaimer in
142630021bStb * the documentation and/or other materials provided with the
152630021bStb * distribution.
162630021bStb *
172630021bStb * 3. All advertising materials mentioning features or use of this
182630021bStb * software must display the following acknowledgment:
192630021bStb * "This product includes software developed by the OpenSSL Project
202630021bStb * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
212630021bStb *
222630021bStb * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
232630021bStb * endorse or promote products derived from this software without
242630021bStb * prior written permission. For written permission, please contact
252630021bStb * openssl-core@OpenSSL.org.
262630021bStb *
272630021bStb * 5. Products derived from this software may not be called "OpenSSL"
282630021bStb * nor may "OpenSSL" appear in their names without prior written
292630021bStb * permission of the OpenSSL Project.
302630021bStb *
312630021bStb * 6. Redistributions of any form whatsoever must retain the following
322630021bStb * acknowledgment:
332630021bStb * "This product includes software developed by the OpenSSL Project
342630021bStb * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
352630021bStb *
362630021bStb * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
372630021bStb * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
382630021bStb * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
392630021bStb * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
402630021bStb * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
412630021bStb * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
422630021bStb * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
432630021bStb * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
442630021bStb * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
452630021bStb * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
462630021bStb * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
472630021bStb * OF THE POSSIBILITY OF SUCH DAMAGE.
482630021bStb * ====================================================================
492630021bStb *
502630021bStb * This product includes cryptographic software written by Eric Young
512630021bStb * (eay@cryptsoft.com). This product includes software written by Tim
522630021bStb * Hudson (tjh@cryptsoft.com).
532630021bStb *
542630021bStb */
552630021bStb
56c00c7526Stb #include <openssl/err.h>
578f6ad591Stb #include <openssl/kdf.h>
58c00c7526Stb
593dca7526Stb #include "err_local.h"
603dca7526Stb
61c00c7526Stb #ifndef OPENSSL_NO_ERR
62c00c7526Stb
633dca7526Stb static const ERR_STRING_DATA KDF_str_functs[] = {
64c00c7526Stb {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_HKDF_CTRL_STR, 0), "pkey_hkdf_ctrl_str"},
65c00c7526Stb {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_HKDF_DERIVE, 0), "pkey_hkdf_derive"},
66c00c7526Stb {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_HKDF_INIT, 0), "pkey_hkdf_init"},
67*b5501fa0Stb {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_TLS1_PRF_CTRL_STR, 0), "pkey_tls1_prf_ctrl_str"},
68*b5501fa0Stb {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_TLS1_PRF_DERIVE, 0), "pkey_tls1_prf_derive"},
69*b5501fa0Stb {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_TLS1_PRF_INIT, 0), "pkey_tls1_prf_init"},
70*b5501fa0Stb {ERR_PACK(ERR_LIB_KDF, KDF_F_TLS1_PRF_ALG, 0), "pkey_tls1_prf_alg"},
7149cc5d01Stb {0, NULL},
72c00c7526Stb };
73c00c7526Stb
743dca7526Stb static const ERR_STRING_DATA KDF_str_reasons[] = {
75*b5501fa0Stb {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_INVALID_DIGEST), "invalid digest"},
76c00c7526Stb {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_MISSING_KEY), "missing key"},
77c00c7526Stb {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_MISSING_MESSAGE_DIGEST),
78c00c7526Stb "missing message digest"},
79*b5501fa0Stb {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_MISSING_SECRET), "missing secret"},
80*b5501fa0Stb {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_MISSING_SEED), "missing seed"},
81c00c7526Stb {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_UNKNOWN_PARAMETER_TYPE),
82c00c7526Stb "unknown parameter type"},
83*b5501fa0Stb {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_VALUE_MISSING), "value missing"},
8449cc5d01Stb {0, NULL},
85c00c7526Stb };
86c00c7526Stb
87c00c7526Stb #endif
88c00c7526Stb
89e3343a65Stb int
ERR_load_KDF_strings(void)90e3343a65Stb ERR_load_KDF_strings(void)
91c00c7526Stb {
92c00c7526Stb #ifndef OPENSSL_NO_ERR
93c00c7526Stb if (ERR_func_error_string(KDF_str_functs[0].error) == NULL) {
943dca7526Stb ERR_load_const_strings(KDF_str_functs);
953dca7526Stb ERR_load_const_strings(KDF_str_reasons);
96c00c7526Stb }
97c00c7526Stb #endif
98c00c7526Stb return 1;
99c00c7526Stb }
100