There is should be no need to rewind the input stream any more.
[openssl.git] / apps / smime.c
index 8d356b5b21b200041bad0ac9415844ee7af9e54e..8c010b3e4717b2dc603424fda2d0ebb4bc4a8f9e 100644 (file)
@@ -167,6 +167,14 @@ int MAIN(int argc, char **argv)
                                cipher = EVP_aes_192_cbc();
                else if (!strcmp(*args,"-aes256"))
                                cipher = EVP_aes_256_cbc();
+#endif
+#ifndef OPENSSL_NO_CAMELLIA
+               else if (!strcmp(*args,"-camellia128"))
+                               cipher = EVP_camellia_128_cbc();
+               else if (!strcmp(*args,"-camellia192"))
+                               cipher = EVP_camellia_192_cbc();
+               else if (!strcmp(*args,"-camellia256"))
+                               cipher = EVP_camellia_256_cbc();
 #endif
                else if (!strcmp (*args, "-text")) 
                                flags |= PKCS7_TEXT;
@@ -348,7 +356,7 @@ int MAIN(int argc, char **argv)
                        }
                else if (args_verify(&args, NULL, &badarg, bio_err, &vpm))
                        continue;
-               else
+               else if ((cipher = EVP_get_cipherbyname(*args + 1)) == NULL)
                        badarg = 1;
                args++;
                }
@@ -429,6 +437,10 @@ int MAIN(int argc, char **argv)
 #ifndef OPENSSL_NO_AES
                BIO_printf (bio_err, "-aes128, -aes192, -aes256\n");
                BIO_printf (bio_err, "               encrypt PEM output with cbc aes\n");
+#endif
+#ifndef OPENSSL_NO_CAMELLIA
+               BIO_printf (bio_err, "-camellia128, -camellia192, -camellia256\n");
+               BIO_printf (bio_err, "               encrypt PEM output with cbc camellia\n");
 #endif
                BIO_printf (bio_err, "-nointern      don't search certificates in message for signer\n");
                BIO_printf (bio_err, "-nosigs        don't verify message signature\n");
@@ -696,11 +708,6 @@ int MAIN(int argc, char **argv)
                        {
                        if (!PKCS7_final(p7, in, flags))
                                goto end;
-                       if (BIO_reset(in) != 0)
-                               {
-                               BIO_puts(bio_err, "Can't rewind input file\n");
-                               goto end;
-                               }
                        }
                }