Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/SoftEtherVPN/SoftEtherVPN_Stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Mayaqua/Encrypt.c')
-rw-r--r--src/Mayaqua/Encrypt.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Mayaqua/Encrypt.c b/src/Mayaqua/Encrypt.c
index 587f7d80..f3b3908e 100644
--- a/src/Mayaqua/Encrypt.c
+++ b/src/Mayaqua/Encrypt.c
@@ -1981,6 +1981,18 @@ X509 *NewX509(K *pub, K *priv, X *ca, NAME *name, UINT days, X_SERIAL *serial)
X509_EXTENSION_free(eku);
}
+ // Alternative subject name
+ if (UniIsEmptyStr(name->CommonName) == false)
+ {
+ char alt_dns[MAX_PATH];
+
+ Format(alt_dns, sizeof(alt_dns), "DNS.1:%S", name->CommonName);
+
+ ex = X509V3_EXT_conf_nid(NULL, NULL, NID_subject_alt_name, alt_dns);
+ X509_add_ext(x509, ex, -1);
+ X509_EXTENSION_free(ex);
+ }
+
Lock(openssl_lock);
{
// Set the public key