certificate_t->issued_by takes an argument to receive signature scheme
This commit is contained in:
@@ -225,7 +225,8 @@ METHOD(certificate_t, has_subject_or_issuer, id_match_t,
|
||||
}
|
||||
|
||||
METHOD(certificate_t, issued_by, bool,
|
||||
private_openssl_crl_t *this, certificate_t *issuer)
|
||||
private_openssl_crl_t *this, certificate_t *issuer,
|
||||
signature_scheme_t *scheme)
|
||||
{
|
||||
chunk_t fingerprint, tbs;
|
||||
public_key_t *key;
|
||||
@@ -270,6 +271,10 @@ METHOD(certificate_t, issued_by, bool,
|
||||
openssl_asn1_str2chunk(this->crl->signature));
|
||||
free(tbs.ptr);
|
||||
key->destroy(key);
|
||||
if (valid && scheme)
|
||||
{
|
||||
*scheme = this->scheme;
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
|
||||
|
||||
@@ -350,7 +350,8 @@ METHOD(certificate_t, has_issuer, id_match_t,
|
||||
}
|
||||
|
||||
METHOD(certificate_t, issued_by, bool,
|
||||
private_openssl_x509_t *this, certificate_t *issuer)
|
||||
private_openssl_x509_t *this, certificate_t *issuer,
|
||||
signature_scheme_t *scheme)
|
||||
{
|
||||
public_key_t *key;
|
||||
bool valid;
|
||||
@@ -393,6 +394,10 @@ METHOD(certificate_t, issued_by, bool,
|
||||
openssl_asn1_str2chunk(this->x509->signature));
|
||||
free(tbs.ptr);
|
||||
key->destroy(key);
|
||||
if (valid && scheme)
|
||||
{
|
||||
*scheme = this->scheme;
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
|
||||
@@ -975,7 +980,7 @@ static bool parse_certificate(private_openssl_x509_t *this)
|
||||
hasher->allocate_hash(hasher, this->encoding, &this->hash);
|
||||
hasher->destroy(hasher);
|
||||
|
||||
if (issued_by(this, &this->public.x509.interface))
|
||||
if (issued_by(this, &this->public.x509.interface, NULL))
|
||||
{
|
||||
this->flags |= X509_SELF_SIGNED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user