Parse UPN subjectAltName in openssl plugin
authorMartin Willi <martin@revosec.ch>
Tue, 10 Aug 2010 15:43:48 +0000 (17:43 +0200)
committerMartin Willi <martin@revosec.ch>
Tue, 10 Aug 2010 16:46:31 +0000 (18:46 +0200)
src/libstrongswan/plugins/openssl/openssl_x509.c

index 1c9bb69..4659e1e 100644 (file)
@@ -187,6 +187,15 @@ static identification_t *general_name2id(GENERAL_NAME *name)
                }
                case GEN_DIRNAME :
                        return openssl_x509_name2id(name->d.directoryName);
+               case GEN_OTHERNAME:
+                       if (OBJ_obj2nid(name->d.otherName->type_id) == NID_ms_upn &&
+                               name->d.otherName->value->type == V_ASN1_UTF8STRING)
+                       {
+                               return identification_create_from_encoding(ID_RFC822_ADDR,
+                                                       openssl_asn1_str2chunk(
+                                                               name->d.otherName->value->value.utf8string));
+                       }
+                       return NULL;
                default:
                        return NULL;
        }