diff options
author | tb <> | 2025-06-07 08:24:15 +0000 |
---|---|---|
committer | tb <> | 2025-06-07 08:24:15 +0000 |
commit | 333e51df7875a01bbb8db90c2186411731000035 (patch) | |
tree | c79d23e9e3422af9b9f87bf9d314a4d81eb45606 | |
parent | 23906d429d230b3a4ab10ff682d2422a4adfa257 (diff) | |
download | openbsd-333e51df7875a01bbb8db90c2186411731000035.tar.gz openbsd-333e51df7875a01bbb8db90c2186411731000035.tar.bz2 openbsd-333e51df7875a01bbb8db90c2186411731000035.zip |
openssl cms: switch default encryption from triple DES to AES-256
The old default is still available with "des3"
https://github.com/pyca/cryptography/issues/12949
https://github.com/libressl/portable/issues/1168
ok kenjiro
-rw-r--r-- | src/usr.bin/openssl/cms.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/usr.bin/openssl/cms.c b/src/usr.bin/openssl/cms.c index 8e5015feba..458ddb0e3b 100644 --- a/src/usr.bin/openssl/cms.c +++ b/src/usr.bin/openssl/cms.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cms.c,v 1.37 2025/05/10 05:25:43 tb Exp $ */ | 1 | /* $OpenBSD: cms.c,v 1.38 2025/06/07 08:24:15 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project. | 3 | * project. |
4 | */ | 4 | */ |
@@ -493,7 +493,7 @@ static const struct option cms_options[] = { | |||
493 | }, | 493 | }, |
494 | { | 494 | { |
495 | .name = "aes256", | 495 | .name = "aes256", |
496 | .desc = "Encrypt PEM output with CBC AES", | 496 | .desc = "Encrypt PEM output with CBC AES (default)", |
497 | .type = OPTION_ARGV_FUNC, | 497 | .type = OPTION_ARGV_FUNC, |
498 | .opt.argvfunc = cms_opt_cipher, | 498 | .opt.argvfunc = cms_opt_cipher, |
499 | }, | 499 | }, |
@@ -527,7 +527,7 @@ static const struct option cms_options[] = { | |||
527 | }, | 527 | }, |
528 | { | 528 | { |
529 | .name = "des3", | 529 | .name = "des3", |
530 | .desc = "Encrypt with triple DES (default)", | 530 | .desc = "Encrypt with triple DES", |
531 | .type = OPTION_ARGV_FUNC, | 531 | .type = OPTION_ARGV_FUNC, |
532 | .opt.argvfunc = cms_opt_cipher, | 532 | .opt.argvfunc = cms_opt_cipher, |
533 | }, | 533 | }, |
@@ -1309,14 +1309,8 @@ cms_main(int argc, char **argv) | |||
1309 | } | 1309 | } |
1310 | 1310 | ||
1311 | if (cfg.operation == SMIME_ENCRYPT) { | 1311 | if (cfg.operation == SMIME_ENCRYPT) { |
1312 | if (cfg.cipher == NULL) { | 1312 | if (cfg.cipher == NULL) |
1313 | #ifndef OPENSSL_NO_DES | 1313 | cfg.cipher = EVP_aes_256_cbc(); |
1314 | cfg.cipher = EVP_des_ede3_cbc(); | ||
1315 | #else | ||
1316 | BIO_printf(bio_err, "No cipher selected\n"); | ||
1317 | goto end; | ||
1318 | #endif | ||
1319 | } | ||
1320 | if (cfg.secret_key != NULL && | 1314 | if (cfg.secret_key != NULL && |
1321 | cfg.secret_keyid == NULL) { | 1315 | cfg.secret_keyid == NULL) { |
1322 | BIO_printf(bio_err, "No secret key id\n"); | 1316 | BIO_printf(bio_err, "No secret key id\n"); |