some bug fix

This commit is contained in:
Zhi Guan
2018-12-06 22:12:05 +08:00
parent bc2bb8a335
commit 9b5eaab86a
19 changed files with 184 additions and 5640 deletions

View File

@@ -67,9 +67,10 @@ ASN1_SEQUENCE(SM2CiphertextValue) = {
IMPLEMENT_ASN1_FUNCTIONS(SM2CiphertextValue)
IMPLEMENT_ASN1_DUP_FUNCTION(SM2CiphertextValue)
int SM2CiphertextValue_size(const EC_GROUP *group, size_t inlen)
int SM2_ciphertext_size(const EC_KEY *ec_key, size_t inlen)
{
int ret;
const EC_GROUP *group = NULL;
ASN1_OCTET_STRING s;
int len = 0, i;
@@ -78,6 +79,10 @@ int SM2CiphertextValue_size(const EC_GROUP *group, size_t inlen)
return 0;
}
if (ec_key) {
group = EC_KEY_get0_group(ec_key);
}
if (group) {
ASN1_INTEGER a;
unsigned char buf[4] = {0xff};