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
+8 -2
View File
@@ -1483,7 +1483,8 @@ end:
/* check if the certificate is self-signed */
if (this->public.interface.interface.issued_by(
&this->public.interface.interface,
&this->public.interface.interface))
&this->public.interface.interface,
NULL))
{
this->flags |= X509_SELF_SIGNED;
}
@@ -1568,7 +1569,8 @@ METHOD(certificate_t, has_issuer, id_match_t,
}
METHOD(certificate_t, issued_by, bool,
private_x509_cert_t *this, certificate_t *issuer)
private_x509_cert_t *this, certificate_t *issuer,
signature_scheme_t *schemep)
{
public_key_t *key;
signature_scheme_t scheme;
@@ -1612,6 +1614,10 @@ METHOD(certificate_t, issued_by, bool,
}
valid = key->verify(key, scheme, this->tbsCertificate, this->signature);
key->destroy(key);
if (valid && schemep)
{
*schemep = scheme;
}
return valid;
}