diff sencrypt.c @ 10:8e9dd5328b5a

Print a warning message when using an insecure algorithm
author Guido Berhoerster <guido+sencrypt@berhoerster.name>
date Sat, 03 Sep 2016 14:02:42 +0200
parents cc930aa0f3c2
children 14e58decdf87
line wrap: on
line diff
--- a/sencrypt.c	Sat Sep 03 11:43:37 2016 +0200
+++ b/sencrypt.c	Sat Sep 03 14:02:42 2016 +0200
@@ -618,6 +618,11 @@
 		status = EXIT_FAILURE;
 		goto out;
 	}
+	if ((cmd == CMD_SENCRYPT) && ((cipher != EVP_aes_128_cbc()) &&
+	    (cipher != EVP_aes_192_cbc()) && (cipher != EVP_aes_256_cbc()))) {
+		fprintf(stderr, "warning: the %s algorithm is no longer "
+		    "considered secure", algo_name);
+	}
 
 	if (iflag) {
 		bio_in = BIO_new_file(in_filename, "r");