summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src/apps/enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libssl/src/apps/enc.c')
-rw-r--r--lib/libssl/src/apps/enc.c42
1 files changed, 15 insertions, 27 deletions
diff --git a/lib/libssl/src/apps/enc.c b/lib/libssl/src/apps/enc.c
index 6f3161395ec..a41ea800ac1 100644
--- a/lib/libssl/src/apps/enc.c
+++ b/lib/libssl/src/apps/enc.c
@@ -127,7 +127,6 @@ int MAIN(int argc, char **argv)
char *engine = NULL;
#endif
const EVP_MD *dgst=NULL;
- int non_fips_allow = 0;
apps_startup();
@@ -262,8 +261,6 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad;
md= *(++argv);
}
- else if (strcmp(*argv,"-non-fips-allow") == 0)
- non_fips_allow = 1;
else if ((argv[0][0] == '-') &&
((c=EVP_get_cipherbyname(&(argv[0][1]))) != NULL))
{
@@ -317,10 +314,7 @@ bad:
if (dgst == NULL)
{
- if (in_FIPS_mode)
- dgst = EVP_sha1();
- else
- dgst = EVP_md5();
+ dgst = EVP_md5();
}
if (bufsize != NULL)
@@ -346,7 +340,7 @@ bad:
}
/* It must be large enough for a base64 encoded line */
- if (n < 80) n=80;
+ if (base64 && n < 80) n=80;
bsize=(int)n;
if (verbose) BIO_printf(bio_err,"bufsize=%d\n",bsize);
@@ -371,12 +365,16 @@ bad:
{
BIO_set_callback(in,BIO_debug_callback);
BIO_set_callback(out,BIO_debug_callback);
- BIO_set_callback_arg(in,bio_err);
- BIO_set_callback_arg(out,bio_err);
+ BIO_set_callback_arg(in,(char *)bio_err);
+ BIO_set_callback_arg(out,(char *)bio_err);
}
if (inf == NULL)
+ {
+ if (bufsize != NULL)
+ setvbuf(stdin, (char *)NULL, _IONBF, 0);
BIO_set_fp(in,stdin,BIO_NOCLOSE);
+ }
else
{
if (BIO_read_filename(in,inf) <= 0)
@@ -427,6 +425,8 @@ bad:
if (outf == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
+ if (bufsize != NULL)
+ setvbuf(stdout, (char *)NULL, _IONBF, 0);
#ifdef OPENSSL_SYS_VMS
{
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
@@ -453,7 +453,7 @@ bad:
if (debug)
{
BIO_set_callback(b64,BIO_debug_callback);
- BIO_set_callback_arg(b64,bio_err);
+ BIO_set_callback_arg(b64,(char *)bio_err);
}
if (olb64)
BIO_set_flags(b64,BIO_FLAGS_BASE64_NO_NL);
@@ -552,19 +552,7 @@ bad:
if (!EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, enc))
{
BIO_printf(bio_err, "Error setting cipher %s\n",
- EVP_CIPHER_name(cipher));
- ERR_print_errors(bio_err);
- goto end;
- }
-
- if (non_fips_allow)
- EVP_CIPHER_CTX_set_flags(ctx,
- EVP_CIPH_FLAG_NON_FIPS_ALLOW);
-
- if (!EVP_CipherInit_ex(ctx, NULL, NULL, key, iv, enc))
- {
- BIO_printf(bio_err, "Error setting cipher %s\n",
- EVP_CIPHER_name(cipher));
+ EVP_CIPHER_name(cipher));
ERR_print_errors(bio_err);
goto end;
}
@@ -575,7 +563,7 @@ bad:
if (!EVP_CipherInit_ex(ctx, NULL, NULL, key, iv, enc))
{
BIO_printf(bio_err, "Error setting cipher %s\n",
- EVP_CIPHER_name(cipher));
+ EVP_CIPHER_name(cipher));
ERR_print_errors(bio_err);
goto end;
}
@@ -583,7 +571,7 @@ bad:
if (debug)
{
BIO_set_callback(benc,BIO_debug_callback);
- BIO_set_callback_arg(benc,bio_err);
+ BIO_set_callback_arg(benc,(char *)bio_err);
}
if (printkey)
@@ -591,7 +579,7 @@ bad:
if (!nosalt)
{
printf("salt=");
- for (i=0; i<sizeof salt; i++)
+ for (i=0; i<(int)sizeof(salt); i++)
printf("%02X",salt[i]);
printf("\n");
}