]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Removed old version of extract_x509_field.
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Thu, 17 Jul 2008 19:07:41 +0000 (19:07 +0000)
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Thu, 17 Jul 2008 19:07:41 +0000 (19:07 +0000)
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@3066 e7ae566f-a301-0410-adde-c780ea21d3b5

ssl.c

diff --git a/ssl.c b/ssl.c
index 6aeac1f8ad23f79089943e498246950229e7c332..bbb998bbb3c8e5823bc91644e34a89b8da95d73b 100644 (file)
--- a/ssl.c
+++ b/ssl.c
@@ -339,44 +339,6 @@ tmp_rsa_cb (SSL * s, int is_export, int keylength)
   return (rsa_tmp);
 }
 
-#ifdef USE_OLD_EXTRACT_X509_FIELD
-
-/*
- * Extract a field from an X509 subject name.
- *
- * Example:
- *
- * /C=US/ST=CO/L=Denver/O=ORG/CN=Test-CA/Email=jim@yonan.net
- *
- * The common name is 'Test-CA'
- */
-static void
-extract_x509_field (const char *x509, const char *field_name, char *out, int size)
-{
-  char field_buf[256];
-  struct buffer x509_buf;
-
-  ASSERT (size > 0);
-  *out = '\0';
-  buf_set_read (&x509_buf, (uint8_t *)x509, strlen (x509));
-  while (buf_parse (&x509_buf, '/', field_buf, sizeof (field_buf)))
-    {
-      struct buffer component_buf;
-      char field_name_buf[64];
-      char field_value_buf[256];
-      buf_set_read (&component_buf, (const uint8_t *) field_buf, strlen (field_buf));
-      buf_parse (&component_buf, '=', field_name_buf, sizeof (field_name_buf));
-      buf_parse (&component_buf, '=', field_value_buf, sizeof (field_value_buf));
-      if (!strcmp (field_name_buf, field_name))
-       {
-         strncpynt (out, field_value_buf, size);
-         break;
-       }
-    }
-}
-
-#else
-
 /*
  * Extract a field from an X509 subject name.
  *
@@ -422,8 +384,6 @@ extract_x509_field_ssl (X509_NAME *x509, const char *field_name, char *out, int
   OPENSSL_free(buf);
 }
 
-#endif
-
 static void
 setenv_untrusted (struct tls_session *session)
 {