isaacpittman-hitachi / rpms / openssl

Forked from rpms/openssl 2 years ago
Clone

Blame SOURCES/0023-cms-stdin.patch

2871ff
diff -up openssl-3.0.0-beta2/apps/cms.c.cms-stdin openssl-3.0.0-beta2/apps/cms.c
2871ff
--- openssl-3.0.0-beta2/apps/cms.c.cms-stdin	2021-08-10 16:20:07.787573587 +0200
2871ff
+++ openssl-3.0.0-beta2/apps/cms.c	2021-08-10 16:23:08.500940124 +0200
2871ff
@@ -278,6 +278,8 @@ static void warn_binary(const char *file
2871ff
     unsigned char linebuf[1024], *cur, *end;
2871ff
     int len;
2871ff
 
2871ff
+    if (file == NULL)
2871ff
+        return; /* cannot give a warning for stdin input */
2871ff
     if ((bio = bio_open_default(file, 'r', FORMAT_BINARY)) == NULL)
2871ff
         return; /* cannot give a proper warning since there is an error */
2871ff
     while ((len = BIO_read(bio, linebuf, sizeof(linebuf))) > 0) {
2871ff
@@ -482,13 +484,9 @@ int cms_main(int argc, char **argv)
2871ff
             rr_allorfirst = 1;
2871ff
             break;
2871ff
         case OPT_RCTFORM:
2871ff
-            if (rctformat == FORMAT_ASN1) {
2871ff
-                if (!opt_format(opt_arg(),
2871ff
-                                OPT_FMT_PEMDER | OPT_FMT_SMIME, &rctformat))
2871ff
-                    goto opthelp;
2871ff
-            } else {
2871ff
-                rcms = load_content_info(rctformat, rctin, 0, NULL, "recipient");
2871ff
-            }
2871ff
+            if (!opt_format(opt_arg(),
2871ff
+                            OPT_FMT_PEMDER | OPT_FMT_SMIME, &rctformat))
2871ff
+                goto opthelp;
2871ff
             break;
2871ff
         case OPT_CERTFILE:
2871ff
             certfile = opt_arg();
2871ff
@@ -954,7 +952,7 @@ int cms_main(int argc, char **argv)
2871ff
             goto end;
2871ff
         }
2871ff
 
2871ff
-        rcms = load_content_info(rctformat, rctin, 0, NULL, "recipient");
2871ff
+        rcms = load_content_info(rctformat, rctin, 0, NULL, "receipt");
2871ff
         if (rcms == NULL)
2871ff
             goto end;
2871ff
     }