remove compiler errors

still some warnings and undef code pieces
This commit is contained in:
Zhi Guan
2017-03-10 21:18:21 +08:00
parent a5e23f6d85
commit edc4e35bf3
22 changed files with 388 additions and 242 deletions

View File

@@ -81,6 +81,10 @@ int BN_GFP2_mul_bn(BN_GFP2 *r, const BN_GFP2 *a, const BIGNUM *b, const BIGNUM *
int BN_GFP2_div_bn(BN_GFP2 *r, const BN_GFP2 *a, const BIGNUM *b, const BIGNUM *p, BN_CTX *ctx);
void BN_GFP2_free(BN_GFP2 *a);
int BN_GFP2_add_bn(BN_GFP2 *r, const BN_GFP2 *a, const BIGNUM *b,
const BIGNUM *p, BN_CTX *ctx);
int BN_bn2gfp2(const BIGNUM *bn, BN_GFP2 *gfp2, const BIGNUM *p, BN_CTX *ctx);
int BN_gfp22bn(const BN_GFP2 *gfp2, BIGNUM *bn, const BIGNUM *p, BN_CTX *ctx);

View File

@@ -62,6 +62,25 @@ extern "C" {
int SAF_PrintNameInfo(FILE *fp, SGD_NAME_INFO *nameInfo);
const char *SAF_GetErrorString(int err);
/* GmSSL Extension */
int SAF_EccSignFile(
void *hAppHandle,
unsigned char *pucContainerName,
unsigned int uiContainerNameLen,
unsigned int uiHashAlgoType,
unsigned char *pucFileName,
unsigned char *pucSignature,
unsigned int *puiSignatureLen);
int SAF_EccVerifySignFile(
unsigned int uiHashAlgoType,
unsigned char *pucPublicKey,
unsigned int uiPublicKeyLen,
unsigned char *pucFileName,
unsigned char *pucSignature,
unsigned int uiSignatureLen);
/* BEGIN ERROR CODES */
/*
* The following lines are auto generated by the script mkerr.pl. Any changes

View File

@@ -100,6 +100,7 @@ int ERR_load_SOF_strings(void);
# define SOF_F_SOF_ENCRYPTFILE 107
# define SOF_F_SOF_EXPORTEXCHANGEUSERCERT 108
# define SOF_F_SOF_EXPORTUSERCERT 109
# define SOF_F_SOF_G 143
# define SOF_F_SOF_GENRANDOM 110
# define SOF_F_SOF_GETCERTINFO 111
# define SOF_F_SOF_GETCERTINFOBYOID 112
@@ -136,6 +137,7 @@ int ERR_load_SOF_strings(void);
/* Reason codes. */
# define SOF_R_DECODE_FAILURE 101
# define SOF_R_INVALID_CERT_ATTRIBUTE 103
# define SOF_R_NOT_IMPLEMENTED 100
# define SOF_R_READ_FILE_FAILURE 102

View File

@@ -4656,10 +4656,6 @@
#define NID_cmac_aes256_ecies 1081
#define OBJ_cmac_aes256_ecies OBJ_secg_scheme,24L,2L
#define SN_cbc_mac "CBC-MAC"
#define LN_cbc_mac "cbc-mac"
#define NID_cbc_mac 1082
#define SN_ISO_CN "ISO-CN"
#define LN_ISO_CN "ISO CN Member Body"
#define NID_ISO_CN 1083
@@ -4835,9 +4831,9 @@
#define NID_sm2sign 1117
#define OBJ_sm2sign OBJ_sm_scheme,301L,1L
#define SN_sm2keyagreement "sm2keyagreement"
#define NID_sm2keyagreement 1118
#define OBJ_sm2keyagreement OBJ_sm_scheme,301L,2L
#define SN_sm2exchange "sm2exchange"
#define NID_sm2exchange 1149
#define OBJ_sm2exchange OBJ_sm_scheme,301L,2L
#define SN_sm2encrypt "sm2encrypt"
#define NID_sm2encrypt 1119
@@ -4963,10 +4959,32 @@
#define NID_r_ate_pairing 1146
#define OBJ_r_ate_pairing OBJ_ibcs1,3L,4L
#define SN_cpk "cpk"
#define SN_GmSSL "gmssl"
#define LN_GmSSL "GmSSL"
#define NID_GmSSL 1150
#define OBJ_GmSSL OBJ_Enterprises,49549L
#define SN_cpk "CPK"
#define LN_cpk "cpk"
#define NID_cpk 1147
#define OBJ_cpk OBJ_sm_scheme,1000L
#define OBJ_cpk OBJ_GmSSL,1L
#define SN_cpk_map "cpk-map"
#define NID_cpk_map 1151
#define OBJ_cpk_map OBJ_cpk,1L
#define SN_cpk_sha1_map "cpk-sha1-map"
#define NID_cpk_sha1_map 1152
#define OBJ_cpk_sha1_map OBJ_cpk_map,1L
#define SN_cpk_sha256_map "cpk-sha256-map"
#define NID_cpk_sha256_map 1153
#define OBJ_cpk_sha256_map OBJ_cpk_map,2L
#define SN_cpk_sm3_map "cpk-sm3-map"
#define NID_cpk_sm3_map 1154
#define OBJ_cpk_sm3_map OBJ_cpk_map,3L
#define SN_paillier "paillier"
#define NID_paillier 1148
#define OBJ_paillier OBJ_sm_scheme,1001L
#define OBJ_paillier OBJ_GmSSL,21L

View File

@@ -595,7 +595,6 @@ int SAF_Pkcs7_DecodeData(
void *hAppHandle,
unsigned char *pucDecContainerName,
unsigned int uiDecContainerNameLen,
unsigned int uiDecKeyUsage,
unsigned char *pucDerP7Data,
unsigned int uiDerP7DataLen,
unsigned char *pucData,
@@ -643,7 +642,6 @@ int SAF_Pkcs7_DecodeEnvelopedData(
void *hAppHandle,
unsigned char *pucDecContainerName,
unsigned int uiDecContainerNameLen,
unsigned int uiDecKeyUsage,
unsigned char *pucDerP7EnvelopedData,
unsigned int uiDerP7EnvelopedDataLen,
unsigned char *pucData,
@@ -659,11 +657,11 @@ int SAF_Pkcs7_EncodeDigestedData(
int SAF_Pkcs7_DecodeDigestedData(
void *hAppHandle,
unsigned int *puiDigestAlgorithm,
unsigned char *pucDerP7DigestedData,
unsigned int uiDerP7DigestedDataLen,
unsigned int *puiDigestAlgorithm,
unsigned char *pucData,
unsigned int uiDataLen,
unsigned int *puiDataLen,
unsigned char *pucDigest,
unsigned int *puiDigestLen);
@@ -671,7 +669,6 @@ int SAF_SM2_EncodeSignedAndEnvelopedData(
void *hAppHandle,
unsigned char *pucSignContainerName,
unsigned int uiSignContainerNameLen,
unsigned int uiSignKeyUsage,
unsigned char *pucSignerCertificate,
unsigned int uiSignerCertificateLen,
unsigned int uiDigestAlgorithm,
@@ -687,14 +684,13 @@ int SAF_SM2_DecodeSignedAndEnvelopedData(
void *hAppHandle,
unsigned char *pucDerContainerName,
unsigned int uiDerContainerNameLen,
unsigned int uiDecKeyUsage,
unsigned char *pucDerSignedAndEnvelopedData,
unsigned int uiDerSignedAndEnvelopedDataLen,
unsigned char *pucData,
unsigned int *puiDataLen,
unsigned char *pucSignerCertificate,
unsigned int *puiSignerCertificateLen,
unsigned int *puiDigestAlgorithms);
unsigned int *puiDigestAlgorithm);
int SAF_SM2_EncodeSignedData(
void *hAppHandle,
@@ -713,11 +709,11 @@ int SAF_SM2_DecodeSignedData(
void *hAppHandle,
unsigned char *pucDerSignedData,
unsigned int uiDerSignedDataLen,
unsigned int *puiDigestAlgorithm,
unsigned char *pucSignerCertificate,
unsigned int uiSignerCertificateLen,
unsigned int uiDigestAlgorithm,
unsigned int *puiSignerCertificateLen,
unsigned char *pucData,
unsigned int uiDataLen,
unsigned int *puiDataLen,
unsigned char *pucSign,
unsigned int *puiSignLen);
@@ -735,7 +731,6 @@ int SAF_SM2_DecodeEnvelopedData(
void *hAppHandle,
unsigned char *pucDecContainerName,
unsigned int uiDecContainerNameLen,
unsigned int uiDecKeyUsage,
unsigned char *pucDerEnvelopedData,
unsigned int uiDerEnvelopedDataLen,
unsigned char *pucData,