From: Alan T. DeKok Date: Thu, 9 Feb 2012 12:29:09 +0000 (+0100) Subject: Manual port of ed8edcac2da6f1db X-Git-Tag: release_3_0_0_beta0~321 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b98af39a9db120f4eb010d35d57087f70ff0dfc4;p=thirdparty%2Ffreeradius-server.git Manual port of ed8edcac2da6f1db Create common name only if there's a subject --- diff --git a/src/main/tls.c b/src/main/tls.c index cf29dd10549..92dae94945a 100644 --- a/src/main/tls.c +++ b/src/main/tls.c @@ -1405,12 +1405,12 @@ int cbtls_verify(int ok, X509_STORE_CTX *ctx) } /* - * Get the Common Name + * Get the Common Name, if there is a subject. */ X509_NAME_get_text_by_NID(X509_get_subject_name(client_cert), NID_commonName, common_name, sizeof(common_name)); common_name[sizeof(common_name) - 1] = '\0'; - if (identity && (lookup <= 1) && common_name[0] && + if (identity && (lookup <= 1) && common_name[0] && subject[0] && (strlen(common_name) < MAX_STRING_LEN)) { pairadd(certs, pairmake(cert_attr_names[FR_TLS_CN][lookup], common_name, T_OP_SET));