comparison 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
comparison
equal deleted inserted replaced
9:cc930aa0f3c2 10:8e9dd5328b5a
616 /* the cipher is determined based on name and length of the key file */ 616 /* the cipher is determined based on name and length of the key file */
617 if (find_algorithm(algo_name, &cipher, &key_len) == -1) { 617 if (find_algorithm(algo_name, &cipher, &key_len) == -1) {
618 status = EXIT_FAILURE; 618 status = EXIT_FAILURE;
619 goto out; 619 goto out;
620 } 620 }
621 if ((cmd == CMD_SENCRYPT) && ((cipher != EVP_aes_128_cbc()) &&
622 (cipher != EVP_aes_192_cbc()) && (cipher != EVP_aes_256_cbc()))) {
623 fprintf(stderr, "warning: the %s algorithm is no longer "
624 "considered secure", algo_name);
625 }
621 626
622 if (iflag) { 627 if (iflag) {
623 bio_in = BIO_new_file(in_filename, "r"); 628 bio_in = BIO_new_file(in_filename, "r");
624 } else { 629 } else {
625 bio_in = BIO_new_fp(stdin, BIO_NOCLOSE); 630 bio_in = BIO_new_fp(stdin, BIO_NOCLOSE);