mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-30 06:33:06 +00:00
Adapt the code to support SAN types: uniformResourceIdentifier, dNSName and IPAddress
According to documentation OPCUA requires: uniformResourceIdentifier, dNSName and IPAddress https://reference.opcfoundation.org/Core/Part6/v105/docs/6.2 Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
parent
6b108606fa
commit
18904acc93
@ -128,16 +128,25 @@ int mbedtls_x509write_csr_set_subject_alternative_name(mbedtls_x509write_csr *ct
|
|||||||
cur = san_list;
|
cur = san_list;
|
||||||
len = 0;
|
len = 0;
|
||||||
while (cur != NULL) {
|
while (cur != NULL) {
|
||||||
MBEDTLS_ASN1_CHK_ADD(len,
|
switch (cur->node.type) {
|
||||||
mbedtls_asn1_write_raw_buffer(&p, buf,
|
case MBEDTLS_X509_SAN_DNS_NAME:
|
||||||
(const unsigned char *) cur->node.name,
|
case MBEDTLS_X509_SAN_UNIFORM_RESOURCE_IDENTIFIER:
|
||||||
cur->node.len));
|
case MBEDTLS_X509_SAN_IP_ADDRESS:
|
||||||
MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&p, buf, cur->node.len));
|
MBEDTLS_ASN1_CHK_ADD(len,
|
||||||
MBEDTLS_ASN1_CHK_ADD(len,
|
mbedtls_asn1_write_raw_buffer(&p, buf,
|
||||||
mbedtls_asn1_write_tag(&p, buf,
|
(const unsigned char *) cur->node
|
||||||
MBEDTLS_ASN1_CONTEXT_SPECIFIC |
|
.name,
|
||||||
cur->node.type));
|
cur->node.len));
|
||||||
|
MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(&p, buf, cur->node.len));
|
||||||
|
MBEDTLS_ASN1_CHK_ADD(len,
|
||||||
|
mbedtls_asn1_write_tag(&p, buf,
|
||||||
|
MBEDTLS_ASN1_CONTEXT_SPECIFIC |
|
||||||
|
cur->node.type));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* Skip unsupported names. */
|
||||||
|
break;
|
||||||
|
}
|
||||||
cur = cur->next;
|
cur = cur->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user