Support different encoding types in certificate.get_encoding()

This commit is contained in:
Martin Willi
2010-07-13 13:53:20 +02:00
parent da9724e6d0
commit 0406eeaacb
27 changed files with 239 additions and 102 deletions
@@ -320,7 +320,12 @@ cert_payload_t *cert_payload_create_from_cert(certificate_t *cert)
free(this);
return NULL;
}
this->data = cert->get_encoding(cert);
if (!cert->get_encoding(cert, CERT_ASN1_DER, &this->data))
{
DBG1(DBG_ENC, "encoding certificate for cert payload failed");
free(this);
return NULL;
}
this->payload_length = CERT_PAYLOAD_HEADER_LENGTH + this->data.len;
return &this->public;
}