Unwrap subjectKeyIdentifier from OCTET_STRING
This commit is contained in:
@@ -666,10 +666,18 @@ static bool parse_authKeyIdentifier_ext(private_openssl_x509_t *this,
|
|||||||
static bool parse_subjectKeyIdentifier_ext(private_openssl_x509_t *this,
|
static bool parse_subjectKeyIdentifier_ext(private_openssl_x509_t *this,
|
||||||
X509_EXTENSION *ext)
|
X509_EXTENSION *ext)
|
||||||
{
|
{
|
||||||
free(this->subjectKeyIdentifier.ptr);
|
chunk_t ostr;
|
||||||
this->subjectKeyIdentifier = chunk_clone(openssl_asn1_str2chunk(
|
|
||||||
X509_EXTENSION_get_data(ext)));
|
ostr = openssl_asn1_str2chunk(X509_EXTENSION_get_data(ext));
|
||||||
return TRUE;
|
/* quick and dirty unwrap of octet string */
|
||||||
|
if (ostr.len > 2 &&
|
||||||
|
ostr.ptr[0] == V_ASN1_OCTET_STRING && ostr.ptr[1] == ostr.len - 2)
|
||||||
|
{
|
||||||
|
free(this->subjectKeyIdentifier.ptr);
|
||||||
|
this->subjectKeyIdentifier = chunk_clone(chunk_skip(ostr, 2));
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user