kdf_err.c (aeccd9ed) kdf_err.c (3dca7526)
1/* $OpenBSD: kdf_err.c,v 1.9 2022/07/12 14:42:49 kn Exp $ */
1/* $OpenBSD: kdf_err.c,v 1.10 2024/06/24 06:43:22 tb Exp $ */
2/* ====================================================================
3 * Copyright (c) 1999-2018 The OpenSSL Project. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright

--- 41 unchanged lines hidden (view full) ---

51 * (eay@cryptsoft.com). This product includes software written by Tim
52 * Hudson (tjh@cryptsoft.com).
53 *
54 */
55
56#include <openssl/err.h>
57#include <openssl/kdf.h>
58
2/* ====================================================================
3 * Copyright (c) 1999-2018 The OpenSSL Project. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright

--- 41 unchanged lines hidden (view full) ---

51 * (eay@cryptsoft.com). This product includes software written by Tim
52 * Hudson (tjh@cryptsoft.com).
53 *
54 */
55
56#include <openssl/err.h>
57#include <openssl/kdf.h>
58
59#include "err_local.h"
60
59#ifndef OPENSSL_NO_ERR
60
61#ifndef OPENSSL_NO_ERR
62
61static ERR_STRING_DATA KDF_str_functs[] = {
63static const ERR_STRING_DATA KDF_str_functs[] = {
62 {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_HKDF_CTRL_STR, 0), "pkey_hkdf_ctrl_str"},
63 {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_HKDF_DERIVE, 0), "pkey_hkdf_derive"},
64 {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_HKDF_INIT, 0), "pkey_hkdf_init"},
65 {0, NULL},
66};
67
64 {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_HKDF_CTRL_STR, 0), "pkey_hkdf_ctrl_str"},
65 {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_HKDF_DERIVE, 0), "pkey_hkdf_derive"},
66 {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_HKDF_INIT, 0), "pkey_hkdf_init"},
67 {0, NULL},
68};
69
68static ERR_STRING_DATA KDF_str_reasons[] = {
70static const ERR_STRING_DATA KDF_str_reasons[] = {
69 {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_MISSING_KEY), "missing key"},
70 {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_MISSING_MESSAGE_DIGEST),
71 "missing message digest"},
72 {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_UNKNOWN_PARAMETER_TYPE),
73 "unknown parameter type"},
74 {0, NULL},
75};
76
77#endif
78
79int
80ERR_load_KDF_strings(void)
81{
82#ifndef OPENSSL_NO_ERR
83 if (ERR_func_error_string(KDF_str_functs[0].error) == NULL) {
71 {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_MISSING_KEY), "missing key"},
72 {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_MISSING_MESSAGE_DIGEST),
73 "missing message digest"},
74 {ERR_PACK(ERR_LIB_KDF, 0, KDF_R_UNKNOWN_PARAMETER_TYPE),
75 "unknown parameter type"},
76 {0, NULL},
77};
78
79#endif
80
81int
82ERR_load_KDF_strings(void)
83{
84#ifndef OPENSSL_NO_ERR
85 if (ERR_func_error_string(KDF_str_functs[0].error) == NULL) {
84 ERR_load_strings(0, KDF_str_functs);
85 ERR_load_strings(0, KDF_str_reasons);
86 ERR_load_const_strings(KDF_str_functs);
87 ERR_load_const_strings(KDF_str_reasons);
86 }
87#endif
88 return 1;
89}
88 }
89#endif
90 return 1;
91}