mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-07 00:46:17 +08:00
143 lines
6.4 KiB
C
143 lines
6.4 KiB
C
/* crypto/cpk/cpk_err.c */
|
|
/* ====================================================================
|
|
* Copyright (c) 1999-2016 The OpenSSL Project. All rights reserved.
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without
|
|
* modification, are permitted provided that the following conditions
|
|
* are met:
|
|
*
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
* notice, this list of conditions and the following disclaimer.
|
|
*
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
* notice, this list of conditions and the following disclaimer in
|
|
* the documentation and/or other materials provided with the
|
|
* distribution.
|
|
*
|
|
* 3. All advertising materials mentioning features or use of this
|
|
* software must display the following acknowledgment:
|
|
* "This product includes software developed by the OpenSSL Project
|
|
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
|
*
|
|
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
|
* endorse or promote products derived from this software without
|
|
* prior written permission. For written permission, please contact
|
|
* openssl-core@OpenSSL.org.
|
|
*
|
|
* 5. Products derived from this software may not be called "OpenSSL"
|
|
* nor may "OpenSSL" appear in their names without prior written
|
|
* permission of the OpenSSL Project.
|
|
*
|
|
* 6. Redistributions of any form whatsoever must retain the following
|
|
* acknowledgment:
|
|
* "This product includes software developed by the OpenSSL Project
|
|
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
|
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
* ====================================================================
|
|
*
|
|
* This product includes cryptographic software written by Eric Young
|
|
* (eay@cryptsoft.com). This product includes software written by Tim
|
|
* Hudson (tjh@cryptsoft.com).
|
|
*
|
|
*/
|
|
|
|
/*
|
|
* NOTE: this file was auto generated by the mkerr.pl script: any changes
|
|
* made to it will be overwritten when the script next updates this file,
|
|
* only reason strings will be preserved.
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <openssl/err.h>
|
|
#include <openssl/cpk.h>
|
|
|
|
/* BEGIN ERROR CODES */
|
|
#ifndef OPENSSL_NO_ERR
|
|
|
|
# define ERR_FUNC(func) ERR_PACK(ERR_LIB_CPK,func,0)
|
|
# define ERR_REASON(reason) ERR_PACK(ERR_LIB_CPK,0,reason)
|
|
|
|
static ERR_STRING_DATA CPK_str_functs[] = {
|
|
{ERR_FUNC(CPK_F_CPK_MAP_NEW_DEFAULT), "CPK_MAP_new_default"},
|
|
{ERR_FUNC(CPK_F_CPK_MAP_NUM_FACTORS), "CPK_MAP_num_factors"},
|
|
{ERR_FUNC(CPK_F_CPK_MAP_NUM_INDEXES), "CPK_MAP_num_indexes"},
|
|
{ERR_FUNC(CPK_F_CPK_MAP_STR2INDEX), "CPK_MAP_str2index"},
|
|
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_CREATE), "CPK_MASTER_SECRET_create"},
|
|
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_DIGEST), "CPK_MASTER_SECRET_digest"},
|
|
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY),
|
|
"CPK_MASTER_SECRET_extract_private_key"},
|
|
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS),
|
|
"CPK_MASTER_SECRET_extract_public_params"},
|
|
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_PRINT), "CPK_MASTER_SECRET_print"},
|
|
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_VALIDATE_PUBLIC_PARAMS),
|
|
"CPK_MASTER_SECRET_validate_public_params"},
|
|
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_COMPUTE_SHARE_KEY),
|
|
"CPK_PUBLIC_PARAMS_compute_share_key"},
|
|
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_DIGEST), "CPK_PUBLIC_PARAMS_digest"},
|
|
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY),
|
|
"CPK_PUBLIC_PARAMS_extract_public_key"},
|
|
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_PRINT), "CPK_PUBLIC_PARAMS_print"},
|
|
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_VALIDATE_PRIVATE_KEY),
|
|
"CPK_PUBLIC_PARAMS_validate_private_key"},
|
|
{ERR_FUNC(CPK_F_X509_ALGOR_GET1_DSA), "X509_ALGOR_GET1_DSA"},
|
|
{ERR_FUNC(CPK_F_X509_ALGOR_GET1_EC_KEY), "X509_ALGOR_GET1_EC_KEY"},
|
|
{0, NULL}
|
|
};
|
|
|
|
static ERR_STRING_DATA CPK_str_reasons[] = {
|
|
{ERR_REASON(CPK_R_ADD_SIGNING_TIME), "add signing time"},
|
|
{ERR_REASON(CPK_R_BAD_ARGUMENT), "bad argument"},
|
|
{ERR_REASON(CPK_R_BAD_DATA), "bad data"},
|
|
{ERR_REASON(CPK_R_DERIVE_KEY_FAILED), "derive key failed"},
|
|
{ERR_REASON(CPK_R_DER_DECODE_FAILED), "der decode failed"},
|
|
{ERR_REASON(CPK_R_DIGEST_FAILED), "digest failed"},
|
|
{ERR_REASON(CPK_R_ECIES_DECRYPT_FAILED), "ecies decrypt failed"},
|
|
{ERR_REASON(CPK_R_ECIES_ENCRYPT_FAILED), "ecies encrypt failed"},
|
|
{ERR_REASON(CPK_R_INVALID_ID_LENGTH), "invalid id length"},
|
|
{ERR_REASON(CPK_R_INVALID_MAP_ALGOR), "invalid map algor"},
|
|
{ERR_REASON(CPK_R_INVALID_PKEY_TYPE), "invalid pkey type"},
|
|
{ERR_REASON(CPK_R_MAP_FAILED), "map failed"},
|
|
{ERR_REASON(CPK_R_PKEY_TYPE_NOT_MATCH), "pkey type not match"},
|
|
{ERR_REASON(CPK_R_SET_RECIP_INFO), "set recip info"},
|
|
{ERR_REASON(CPK_R_SET_SIGNER), "set signer"},
|
|
{ERR_REASON(CPK_R_STACK_ERROR), "stack error"},
|
|
{ERR_REASON(CPK_R_UNABLE_TO_FIND_MESSAGE_DIGEST),
|
|
"unable to find message digest"},
|
|
{ERR_REASON(CPK_R_UNKNOWN_CIPHER_TYPE), "unknown cipher type"},
|
|
{ERR_REASON(CPK_R_UNKNOWN_CURVE), "unknown curve"},
|
|
{ERR_REASON(CPK_R_UNKNOWN_DIGEST_TYPE), "unknown digest type"},
|
|
{ERR_REASON(CPK_R_UNKNOWN_ECDH_TYPE), "unknown ecdh type"},
|
|
{ERR_REASON(CPK_R_UNKNOWN_MAP_TYPE), "unknown map type"},
|
|
{ERR_REASON(CPK_R_UNKNOWN_PKCS7_TYPE), "unknown pkcs7 type"},
|
|
{ERR_REASON(CPK_R_UNSUPPORTED_PKCS7_CONTENT_TYPE),
|
|
"unsupported pkcs7 content type"},
|
|
{ERR_REASON(CPK_R_VERIFY_FAILED), "verify failed"},
|
|
{ERR_REASON(CPK_R_WITHOUT_DECRYPT_KEY), "without decrypt key"},
|
|
{0, NULL}
|
|
};
|
|
|
|
#endif
|
|
|
|
void ERR_load_CPK_strings(void)
|
|
{
|
|
#ifndef OPENSSL_NO_ERR
|
|
|
|
if (ERR_func_error_string(CPK_str_functs[0].error) == NULL) {
|
|
ERR_load_strings(0, CPK_str_functs);
|
|
ERR_load_strings(0, CPK_str_reasons);
|
|
}
|
|
#endif
|
|
}
|