certificate_t->issued_by takes an argument to receive signature scheme

This commit is contained in:
Martin Willi
2012-06-12 14:24:49 +02:00
parent 439d0742e9
commit a37f2d2006
16 changed files with 68 additions and 24 deletions
@@ -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;
}