fix warnings

This commit is contained in:
Zhi Guan
2019-08-13 16:56:23 +08:00
parent a64ac54993
commit cbf7cbb40d
13 changed files with 5155 additions and 5673 deletions

View File

@@ -113,15 +113,19 @@ int ECIES_PARAMS_init_with_recommended(ECIES_PARAMS *param)
}
memset(param, 0, sizeof(*param));
#ifndef OPENSSL_NO_SHA
#ifndef OPENSSL_NO_SHA256
param->kdf_nid = NID_x9_63_kdf;
param->kdf_md = EVP_sha256();
param->enc_nid = NID_xor_in_ecies;
param->mac_nid = NID_hmac_full_ecies;
param->hmac_md = EVP_sha256();
// we should return error when sha256 disabled
#endif
return 1;
#else
ECerr(EC_F_ECIES_PARAMS_INIT_WITH_RECOMMENDED,
EC_R_INVALID_ECIES_PARAMS);
return 0;
#endif
}
KDF_FUNC ECIES_PARAMS_get_kdf(const ECIES_PARAMS *param)
@@ -162,11 +166,6 @@ int ECIES_PARAMS_get_enc(const ECIES_PARAMS *param, size_t inlen,
cipher = NULL;
keylen = inlen;
break;
#ifndef OPENSSL_NO_DES
case NID_tdes_cbc_in_ecies:
cipher = EVP_des_ede_cbc();
break;
#endif
#ifndef OPENSSL_NO_AES
case NID_aes128_cbc_in_ecies:
cipher = EVP_aes_128_cbc();

View File

@@ -48,6 +48,7 @@
*/
#include <stdio.h>
#include <string.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include <openssl/paillier.h>

View File

@@ -47,6 +47,7 @@
* ====================================================================
*/
#include <string.h>
#include <openssl/err.h>
#include <openssl/gmsdf.h>
#include "internal/sdf_int.h"

View File

@@ -205,7 +205,7 @@ int SM9_compute_share_key_A(int type,
}
/* get IDA */
IDA = ASN1_STRING_get0_data(skA->identity);
IDA = (char *)ASN1_STRING_get0_data(skA->identity);
IDAlen = ASN1_STRING_length(skA->identity);
/* malloc */
@@ -379,7 +379,7 @@ int SM9_compute_share_key_B(int type,
}
/* get IDB */
IDB = ASN1_STRING_get0_data(skB->identity);
IDB = (char *)ASN1_STRING_get0_data(skB->identity);
IDBlen = ASN1_STRING_length(skB->identity);
/* malloc */