mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-12 19:36:27 +08:00
SKF Wrapper
This commit is contained in:
@@ -1,75 +1,96 @@
|
||||
#ifndef HEADER_SKF_ERR_H
|
||||
#define HEADER_SKF_ERR_H
|
||||
/* engines/e_skf_err.h */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2015-2016 The GmSSL 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 GmSSL Project.
|
||||
* (http://gmssl.org/)"
|
||||
*
|
||||
* 4. The name "GmSSL Project" must not be used to endorse or promote
|
||||
* products derived from this software without prior written
|
||||
* permission. For written permission, please contact
|
||||
* guanzhi1980@gmail.com.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "GmSSL"
|
||||
* nor may "GmSSL" appear in their names without prior written
|
||||
* permission of the GmSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the GmSSL Project
|
||||
* (http://gmssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
|
||||
* ====================================================================
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HEADER_E_SKF_ERR_H
|
||||
#define HEADER_E_SKF_ERR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/*
|
||||
* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
static void ERR_load_ESKF_strings(void);
|
||||
static void ERR_unload_ESKF_strings(void);
|
||||
static void ERR_ESKF_error(int function, int reason, char *file, int line);
|
||||
# define ESKFerr(f,r) ERR_ESKF_error((f),(r),__FILE__,__LINE__)
|
||||
|
||||
static void ERR_load_SKF_strings(void);
|
||||
static void ERR_unload_SKF_strings(void);
|
||||
static void ERR_SKF_error(int function, int reason, char *file, int line);
|
||||
# define SKFerr(f,r) ERR_SKF_error((f),(r),__FILE__,__LINE__)
|
||||
|
||||
|
||||
/* Error codes for the ESKF functions. */
|
||||
|
||||
/* Function codes. */
|
||||
#define SKF_F_SKF_RAND 100
|
||||
|
||||
# define ESKF_F_OPEN_APP 100
|
||||
# define ESKF_F_OPEN_CONTAINER 101
|
||||
# define ESKF_F_OPEN_DEV 102
|
||||
# define ESKF_F_SET_AUTHKEY 103
|
||||
# define ESKF_F_SET_USERPIN 104
|
||||
# define ESKF_F_SKF_CIPHER 105
|
||||
# define ESKF_F_SKF_CIPHERS 106
|
||||
# define ESKF_F_SKF_DIGESTS 107
|
||||
# define ESKF_F_SKF_ENGINE_CTRL 108
|
||||
# define ESKF_F_SKF_FINISH 109
|
||||
# define ESKF_F_SKF_INIT 110
|
||||
# define ESKF_F_SKF_INIT_KEY 111
|
||||
# define ESKF_F_SKF_LOAD_PUBKEY 112
|
||||
# define ESKF_F_SKF_RAND_BYTES 113
|
||||
# define ESKF_F_SKF_RSA_SIGN 114
|
||||
# define ESKF_F_SKF_SM2_DO_SIGN 115
|
||||
# define ESKF_F_SKF_SM3_FINAL 116
|
||||
# define ESKF_F_SKF_SM3_INIT 117
|
||||
# define ESKF_F_SKF_SM3_UPDATE 118
|
||||
|
||||
/* Reason codes. */
|
||||
#define SKF_R_OK 110
|
||||
#define SKF_R_FAIL 101
|
||||
#define SKF_R_UNKNOWNERR 102
|
||||
#define SKF_R_NOTSUPPORTYETERR 103
|
||||
#define SKF_R_FILEERR 104
|
||||
#define SKF_R_INVALIDHANDLEERR 105
|
||||
#define SKF_R_INVALIDPARAMERR 106
|
||||
#define SKF_R_READFILEERR 107
|
||||
#define SKF_R_WRITEFILEERR 108
|
||||
#define SKF_R_NAMELENERR 109
|
||||
#define SKF_R_KEYUSAGEERR 110
|
||||
#define SKF_R_MODULUSLENERR 111
|
||||
#define SKF_R_NOTINITIALIZEERR 112
|
||||
#define SKF_R_OBJERR 113
|
||||
#define SKF_R_MEMORYERR 114
|
||||
#define SKF_R_TIMEOUTERR 115
|
||||
#define SKF_R_INDATALENERR 116
|
||||
#define SKF_R_INDATAERR 117
|
||||
#define SKF_R_GENRANDERR 118
|
||||
#define SKF_R_HASHOBJERR 119
|
||||
#define SKF_R_HASHERR 120
|
||||
#define SKF_R_GENRSAKEYERR 121
|
||||
#define SKF_R_RSAMODULUSLENERR 122
|
||||
#define SKF_R_CSPIMPRTPUBKEYERR 123
|
||||
#define SKF_R_RSAENCERR 124
|
||||
#define SKF_R_RSADECERR 125
|
||||
#define SKF_R_HASHNOTEQUALERR 126
|
||||
#define SKF_R_KEYNOTFOUNTERR 127
|
||||
#define SKF_R_CERTNOTFOUNTERR 128
|
||||
#define SKF_R_NOTEXPORTERR 129
|
||||
#define SKF_R_DECRYPTPADERR 130
|
||||
#define SKF_R_MACLENERR 131
|
||||
#define SKF_R_BUFFER_TOO_SMALL 132
|
||||
#define SKF_R_KEYINFOTYPEERR 133
|
||||
#define SKF_R_NOT_EVENTERR 134
|
||||
#define SKF_R_DEVICE_REMOVED 135
|
||||
#define SKF_R_PIN_INCORRECT 136
|
||||
#define SKF_R_PIN_LOCKED 137
|
||||
#define SKF_R_PIN_INVALID 138
|
||||
#define SKF_R_PIN_LEN_RANGE 139
|
||||
#define SKF_R_USER_ALREADY_LOGGED_IN 140
|
||||
#define SKF_R_USER_PIN_NOT_INITIALIZED 141
|
||||
#define SKF_R_USER_TYPE_INVALID 142
|
||||
#define SKF_R_APPLICATION_NAME_INVALID 143
|
||||
#define SKF_R_APPLICATION_EXISTS 144
|
||||
#define SKF_R_USER_NOT_LOGGED_IN 145
|
||||
#define SKF_R_APPLICATION_NOT_EXISTS 146
|
||||
#define SKF_R_FILE_ALREADY_EXIST 147
|
||||
#define SKF_R_NO_ROOM 148
|
||||
#define SKF_R_FILE_NOT_EXIST 149
|
||||
|
||||
# define ESKF_R_NOT_IMPLEMENTED 100
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user