Renamed key_encod{ing,der}_t and constants, prepare for generic credential encoding
This commit is contained in:
@@ -568,7 +568,7 @@ static chunk_t build_authorityKeyIdentifier(private_x509_ac_t *this)
|
||||
public = this->signerCert->get_public_key(this->signerCert);
|
||||
if (public)
|
||||
{
|
||||
if (public->get_fingerprint(public, KEY_ID_PUBKEY_SHA1, &keyIdentifier))
|
||||
if (public->get_fingerprint(public, KEYID_PUBKEY_SHA1, &keyIdentifier))
|
||||
{
|
||||
this->authKeyIdentifier = chunk_clone(keyIdentifier);
|
||||
}
|
||||
@@ -749,7 +749,7 @@ static bool issued_by(private_x509_ac_t *this, certificate_t *issuer)
|
||||
{
|
||||
chunk_t fingerprint;
|
||||
|
||||
if (!key->get_fingerprint(key, KEY_ID_PUBKEY_SHA1, &fingerprint) ||
|
||||
if (!key->get_fingerprint(key, KEYID_PUBKEY_SHA1, &fingerprint) ||
|
||||
!chunk_equals(fingerprint, this->authKeyIdentifier))
|
||||
{
|
||||
return FALSE;
|
||||
|
||||
@@ -1274,7 +1274,7 @@ static chunk_t get_subjectKeyIdentifier(private_x509_cert_t *this)
|
||||
chunk_t fingerprint;
|
||||
|
||||
if (this->public_key->get_fingerprint(this->public_key,
|
||||
KEY_ID_PUBKEY_SHA1, &fingerprint))
|
||||
KEYID_PUBKEY_SHA1, &fingerprint))
|
||||
{
|
||||
return fingerprint;
|
||||
}
|
||||
@@ -1528,7 +1528,7 @@ static bool generate(private_x509_cert_t *cert, certificate_t *sign_cert,
|
||||
scheme = signature_scheme_from_oid(cert->algorithm);
|
||||
|
||||
if (!cert->public_key->get_encoding(cert->public_key,
|
||||
KEY_PUB_SPKI_ASN1_DER, &key_info))
|
||||
PUBKEY_SPKI_ASN1_DER, &key_info))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1642,7 +1642,7 @@ static bool generate(private_x509_cert_t *cert, certificate_t *sign_cert,
|
||||
chunk_t keyid;
|
||||
|
||||
if (cert->public_key->get_fingerprint(cert->public_key,
|
||||
KEY_ID_PUBKEY_SHA1, &keyid))
|
||||
KEYID_PUBKEY_SHA1, &keyid))
|
||||
{
|
||||
subjectKeyIdentifier = asn1_wrap(ASN1_SEQUENCE, "mm",
|
||||
asn1_build_known_oid(OID_SUBJECT_KEY_ID),
|
||||
@@ -1656,7 +1656,7 @@ static bool generate(private_x509_cert_t *cert, certificate_t *sign_cert,
|
||||
{
|
||||
chunk_t keyid;
|
||||
|
||||
if (sign_key->get_fingerprint(sign_key, KEY_ID_PUBKEY_SHA1, &keyid))
|
||||
if (sign_key->get_fingerprint(sign_key, KEYID_PUBKEY_SHA1, &keyid))
|
||||
{
|
||||
authKeyIdentifier = asn1_wrap(ASN1_SEQUENCE, "mm",
|
||||
asn1_build_known_oid(OID_AUTHORITY_KEY_ID),
|
||||
|
||||
@@ -401,7 +401,7 @@ METHOD(certificate_t, issued_by, bool,
|
||||
{
|
||||
chunk_t fingerprint;
|
||||
|
||||
if (!key->get_fingerprint(key, KEY_ID_PUBKEY_SHA1, &fingerprint) ||
|
||||
if (!key->get_fingerprint(key, KEYID_PUBKEY_SHA1, &fingerprint) ||
|
||||
!chunk_equals(fingerprint, this->authKeyIdentifier))
|
||||
{
|
||||
return FALSE;
|
||||
|
||||
@@ -153,7 +153,7 @@ static chunk_t build_requestList(private_x509_ocsp_request_t *this)
|
||||
hasher_t *hasher = lib->crypto->create_hasher(lib->crypto, HASH_SHA1);
|
||||
if (hasher)
|
||||
{
|
||||
if (public->get_fingerprint(public, KEY_ID_PUBKEY_SHA1,
|
||||
if (public->get_fingerprint(public, KEYID_PUBKEY_SHA1,
|
||||
&issuerKeyHash))
|
||||
{
|
||||
enumerator_t *enumerator;
|
||||
|
||||
@@ -167,7 +167,7 @@ static cert_validation_t get_status(private_x509_ocsp_response_t *this,
|
||||
{
|
||||
hasher_t *hasher;
|
||||
identification_t *id;
|
||||
key_encoding_type_t type;
|
||||
cred_encoding_type_t type;
|
||||
chunk_t hash, fingerprint;
|
||||
|
||||
/* check serial first, is cheaper */
|
||||
@@ -188,7 +188,7 @@ static cert_validation_t get_status(private_x509_ocsp_response_t *this,
|
||||
switch (response->hashAlgorithm)
|
||||
{
|
||||
case OID_SHA1:
|
||||
type = KEY_ID_PUBKEY_SHA1;
|
||||
type = KEYID_PUBKEY_SHA1;
|
||||
break;
|
||||
default:
|
||||
public->destroy(public);
|
||||
@@ -698,7 +698,7 @@ static bool issued_by(private_x509_ocsp_response_t *this, certificate_t *issuer)
|
||||
|
||||
key = issuer->get_public_key(issuer);
|
||||
if (!key ||
|
||||
!key->get_fingerprint(key, KEY_ID_PUBKEY_SHA1, &fingerprint) ||
|
||||
!key->get_fingerprint(key, KEYID_PUBKEY_SHA1, &fingerprint) ||
|
||||
!chunk_equals(fingerprint,
|
||||
this->responderId->get_encoding(this->responderId)))
|
||||
{
|
||||
|
||||
@@ -550,7 +550,7 @@ static bool generate(private_x509_pkcs10_t *cert, private_key_t *sign_key,
|
||||
scheme = signature_scheme_from_oid(cert->algorithm);
|
||||
|
||||
if (!cert->public_key->get_encoding(cert->public_key,
|
||||
KEY_PUB_SPKI_ASN1_DER, &key_info))
|
||||
PUBKEY_SPKI_ASN1_DER, &key_info))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user