mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-08-08 23:13:38 +08:00
remove warnings
This commit is contained in:
@@ -401,7 +401,7 @@ int SM2CiphertextValue_get_ECCCipher(const SM2CiphertextValue *cv,
|
||||
* structure and prepared enough buffer to hold variable length
|
||||
* ciphertext
|
||||
*/
|
||||
if (ref->L < ASN1_STRING_length(cv->ciphertext)) {
|
||||
if (ref->L < (unsigned int)ASN1_STRING_length(cv->ciphertext)) {
|
||||
GMAPIerr(GMAPI_F_SM2CIPHERTEXTVALUE_GET_ECCCIPHER,
|
||||
GMAPI_R_BUFFER_TOO_SMALL);
|
||||
return 0;
|
||||
@@ -625,18 +625,6 @@ end:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
ECCCipher *d2i_ECCCipher_bio(BIO *bp, ECCCipher **a)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ECCCipher *d2i_ECCCipher_fp(FILE *fp, ECCCipher **a)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
*/
|
||||
|
||||
int i2d_ECCCipher(ECCCipher *a, unsigned char **pp)
|
||||
{
|
||||
int ret;
|
||||
@@ -652,24 +640,18 @@ int i2d_ECCCipher(ECCCipher *a, unsigned char **pp)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
int i2d_ECCCipher_bio(BIO *bp, ECCCipher *a)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int i2d_ECCCipher_fp(FILE *fp, ECCCipher *a)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
ECCSignature *d2i_ECCSignature(ECCSignature **a, const unsigned char **pp, long length)
|
||||
{
|
||||
ECCSignature *ret = NULL;
|
||||
ECCSignature *sdf_sig = NULL;
|
||||
ECDSA_SIG *sig = NULL;
|
||||
|
||||
|
||||
/* FIXME: `a` not set */
|
||||
(void)a;
|
||||
|
||||
|
||||
|
||||
if (!(sig = d2i_ECDSA_SIG(NULL, pp, length))) {
|
||||
GMAPIerr(GMAPI_F_D2I_ECCSIGNATURE, ERR_R_EC_LIB);
|
||||
goto end;
|
||||
@@ -694,18 +676,6 @@ end:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
ECCSignature *d2i_ECCSignature_bio(BIO *bp, ECCSignature **a)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ECCSignature *d2i_ECCSignature_fp(FILE *fp, ECCSignature **a)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
*/
|
||||
|
||||
int i2d_ECCSignature(ECCSignature *a, unsigned char **pp)
|
||||
{
|
||||
int ret;
|
||||
@@ -721,18 +691,6 @@ int i2d_ECCSignature(ECCSignature *a, unsigned char **pp)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
int i2d_ECCSignature_bio(BIO *bp, ECCSignature *a)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int i2d_ECCSignature_fp(FILE *fp, ECCSignature *a)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
# ifndef OPENSSL_NO_ECIES
|
||||
ECIES_CIPHERTEXT_VALUE *ECIES_CIPHERTEXT_VALUE_new_from_ECCCipher(
|
||||
const ECCCipher *ref)
|
||||
|
||||
@@ -309,7 +309,7 @@ int SM2CiphertextValue_get_ECCCIPHERBLOB(const SM2CiphertextValue *cv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (blob->CipherLen < ASN1_STRING_length(cv->ciphertext)) {
|
||||
if (blob->CipherLen < (unsigned int)ASN1_STRING_length(cv->ciphertext)) {
|
||||
GMAPIerr(GMAPI_F_SM2CIPHERTEXTVALUE_GET_ECCCIPHERBLOB,
|
||||
GMAPI_R_BUFFER_TOO_SMALL);
|
||||
return 0;
|
||||
@@ -378,7 +378,8 @@ int ECDSA_SIG_set_ECCSIGNATUREBLOB(ECDSA_SIG *sig, const ECCSIGNATUREBLOB *blob)
|
||||
|
||||
int ECDSA_SIG_get_ECCSIGNATUREBLOB(const ECDSA_SIG *sig, ECCSIGNATUREBLOB *blob)
|
||||
{
|
||||
if ((BN_num_bytes(sig->r) > sizeof(blob->r)) || (BN_num_bytes(sig->s) > sizeof(blob->s))) {
|
||||
if (((size_t)BN_num_bytes(sig->r) > sizeof(blob->r))
|
||||
|| ((size_t)BN_num_bytes(sig->s) > sizeof(blob->s))) {
|
||||
GMAPIerr(GMAPI_F_ECDSA_SIG_GET_ECCSIGNATUREBLOB, GMAPI_R_INVALID_BIGNUM_LENGTH);
|
||||
return 0;
|
||||
}
|
||||
@@ -545,13 +546,13 @@ int ECIES_CIPHERTEXT_VALUE_get_ECCCIPHERBLOB(const ECIES_CIPHERTEXT_VALUE *cv, E
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (BN_num_bytes(x) > sizeof(blob->XCoordinate)) {
|
||||
if ((size_t)BN_num_bytes(x) > sizeof(blob->XCoordinate)) {
|
||||
GMAPIerr(GMAPI_F_ECIES_CIPHERTEXT_VALUE_GET_ECCCIPHERBLOB, GMAPI_R_INVALID_SKF_EC_CIPHERTEXT);
|
||||
goto end;
|
||||
}
|
||||
BN_bn2bin(x, blob->XCoordinate + sizeof(blob->XCoordinate) - BN_num_bytes(x));
|
||||
|
||||
if (BN_num_bytes(y) > sizeof(blob->YCoordinate)) {
|
||||
if ((size_t)BN_num_bytes(y) > sizeof(blob->YCoordinate)) {
|
||||
GMAPIerr(GMAPI_F_ECIES_CIPHERTEXT_VALUE_GET_ECCCIPHERBLOB, GMAPI_R_INVALID_SKF_EC_CIPHERTEXT);
|
||||
goto end;
|
||||
}
|
||||
@@ -585,6 +586,9 @@ ECCCIPHERBLOB *d2i_ECCCIPHERBLOB(ECCCIPHERBLOB **a, const unsigned char **pp, lo
|
||||
ECCCIPHERBLOB *blob = NULL;
|
||||
SM2CiphertextValue *cv = NULL;
|
||||
|
||||
/* FIXME: set `a` */
|
||||
(void)a;
|
||||
|
||||
if (!(cv = d2i_SM2CiphertextValue(NULL, pp, length))) {
|
||||
GMAPIerr(GMAPI_F_D2I_ECCCIPHERBLOB, ERR_R_SM2_LIB);
|
||||
goto end;
|
||||
@@ -632,6 +636,9 @@ ECCSIGNATUREBLOB *d2i_ECCSIGNATUREBLOB(ECCSIGNATUREBLOB **a, const unsigned char
|
||||
ECCSIGNATUREBLOB *blob = NULL;
|
||||
ECDSA_SIG *sig = NULL;
|
||||
|
||||
/* FIXME: set `a` */
|
||||
(void)a;
|
||||
|
||||
if (!(sig = d2i_ECDSA_SIG(NULL, pp, length))) {
|
||||
GMAPIerr(GMAPI_F_D2I_ECCSIGNATUREBLOB, ERR_R_EC_LIB);
|
||||
goto end;
|
||||
|
||||
Reference in New Issue
Block a user