Latest update
This commit is contained in:
@@ -145,7 +145,7 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it,
|
||||
unsigned char *buf_in = NULL, *buf_out = NULL;
|
||||
size_t inl = 0, outl = 0, outll = 0;
|
||||
int signid, paramtype, buf_len = 0;
|
||||
int rv;
|
||||
int rv, pkey_id;
|
||||
|
||||
type = EVP_MD_CTX_md(ctx);
|
||||
pkey = EVP_PKEY_CTX_get0_pkey(EVP_MD_CTX_pkey_ctx(ctx));
|
||||
@@ -184,9 +184,14 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it,
|
||||
ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ASN1_R_CONTEXT_NOT_INITIALISED);
|
||||
goto err;
|
||||
}
|
||||
if (!OBJ_find_sigid_by_algs(&signid,
|
||||
EVP_MD_nid(type),
|
||||
pkey->ameth->pkey_id)) {
|
||||
|
||||
pkey_id =
|
||||
#ifndef OPENSSL_NO_SM2
|
||||
EVP_PKEY_id(pkey) == NID_sm2 ? NID_sm2 :
|
||||
#endif
|
||||
pkey->ameth->pkey_id;
|
||||
|
||||
if (!OBJ_find_sigid_by_algs(&signid, EVP_MD_nid(type), pkey_id)) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX,
|
||||
ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED);
|
||||
goto err;
|
||||
|
||||
@@ -67,7 +67,7 @@ static void determine_days(struct tm *tm)
|
||||
}
|
||||
c = y / 100;
|
||||
y %= 100;
|
||||
/* Zeller's congruance */
|
||||
/* Zeller's congruence */
|
||||
tm->tm_wday = (d + (13 * m) / 5 + y + y / 4 + c / 4 + 5 * c + 6) % 7;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,9 @@
|
||||
|
||||
int ASN1_TYPE_get(const ASN1_TYPE *a)
|
||||
{
|
||||
if ((a->value.ptr != NULL) || (a->type == V_ASN1_NULL))
|
||||
if (a->type == V_ASN1_BOOLEAN
|
||||
|| a->type == V_ASN1_NULL
|
||||
|| a->value.ptr != NULL)
|
||||
return a->type;
|
||||
else
|
||||
return 0;
|
||||
@@ -23,7 +25,9 @@ int ASN1_TYPE_get(const ASN1_TYPE *a)
|
||||
|
||||
void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value)
|
||||
{
|
||||
if (a->value.ptr != NULL) {
|
||||
if (a->type != V_ASN1_BOOLEAN
|
||||
&& a->type != V_ASN1_NULL
|
||||
&& a->value.ptr != NULL) {
|
||||
ASN1_TYPE **tmp_a = &a;
|
||||
asn1_primitive_free((ASN1_VALUE **)tmp_a, NULL, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user