summaryrefslogtreecommitdiff
path: root/usr.bin/openssl/enc.c
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2021-12-07 20:13:16 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2021-12-07 20:13:16 +0000
commitcd2390e7e5d19bbbd23af90683becd4feedfab6b (patch)
tree5a137cb3625db21cf87ee44225d7c45e247a13db /usr.bin/openssl/enc.c
parent4c7fcaf90f04e88eb93bce0e09b41e40f6b28c2f (diff)
Simple conversion to opaque EVP_CIPHER.
Diffstat (limited to 'usr.bin/openssl/enc.c')
-rw-r--r--usr.bin/openssl/enc.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.bin/openssl/enc.c b/usr.bin/openssl/enc.c
index ed18527fcf2..7955d9b9401 100644
--- a/usr.bin/openssl/enc.c
+++ b/usr.bin/openssl/enc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: enc.c,v 1.23 2019/07/25 11:42:12 bcook Exp $ */
+/* $OpenBSD: enc.c,v 1.24 2021/12/07 20:13:15 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -703,21 +703,25 @@ enc_main(int argc, char **argv)
BIO_set_callback_arg(benc, (char *) bio_err);
}
if (enc_config.printkey) {
+ int key_len, iv_len;
+
if (!enc_config.nosalt) {
printf("salt=");
for (i = 0; i < (int) sizeof(salt); i++)
printf("%02X", salt[i]);
printf("\n");
}
- if (enc_config.cipher->key_len > 0) {
+ key_len = EVP_CIPHER_key_length(enc_config.cipher);
+ if (key_len > 0) {
printf("key=");
- for (i = 0; i < enc_config.cipher->key_len; i++)
+ for (i = 0; i < key_len; i++)
printf("%02X", key[i]);
printf("\n");
}
- if (enc_config.cipher->iv_len > 0) {
+ iv_len = EVP_CIPHER_iv_length(enc_config.cipher);
+ if (iv_len > 0) {
printf("iv =");
- for (i = 0; i < enc_config.cipher->iv_len; i++)
+ for (i = 0; i < iv_len; i++)
printf("%02X", iv[i]);
printf("\n");
}