[Pkg-openssl-devel] Bug#404700: Confirmed -- Proposed Patch

Scott Schaefer saschaefer at neurodiverse.org
Tue May 3 22:21:47 UTC 2011


Confirmed bug in apps/req.c.

When executed w/-batch argument, cannot retry input from user which 
fails min/max length check.  Must instead fail.

Proposed patch

--- a/apps/req.c
+++ b/apps/req.c
@@ -1477,7 +1477,13 @@
  #ifdef CHARSET_EBCDIC
      ebcdic2ascii(buf, buf, i);
  #endif
-    if(!req_check_len(i, n_min, n_max)) goto start;
+    if (!req_check_len(i, n_min, n_max))
+        {
+        if (!batch)
+            goto start;
+        else
+            return 0;
+        }
      if (!X509_NAME_add_entry_by_NID(n,nid, chtype,
                  (unsigned char *) buf, -1,-1,mval)) goto err;
      ret=1;
@@ -1536,7 +1542,13 @@
  #ifdef CHARSET_EBCDIC
      ebcdic2ascii(buf, buf, i);
  #endif
-    if(!req_check_len(i, n_min, n_max)) goto start;
+    if (!req_check_len(i, n_min, n_max))
+        {
+        if (!batch)
+            goto start;
+        else
+            return 0;
+        }

      if(!X509_REQ_add1_attr_by_NID(req, nid, chtype,
                      (unsigned char *)buf, -1)) {






More information about the Pkg-openssl-devel mailing list