summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2023-06-11 05:45:20 +0000
committertb <>2023-06-11 05:45:20 +0000
commit1bfadb04fff2939c5bcb486189a56739bdd8ca85 (patch)
tree7afcbaa0061eed663aff3bfb00ffe97e6da58371
parent52c7413490876d8fe7446a40eec79f0a1a74ffc7 (diff)
downloadopenbsd-1bfadb04fff2939c5bcb486189a56739bdd8ca85.tar.gz
openbsd-1bfadb04fff2939c5bcb486189a56739bdd8ca85.tar.bz2
openbsd-1bfadb04fff2939c5bcb486189a56739bdd8ca85.zip
Unifdef ZLIB
This is very dead code: the openssl app was never compiled with -DZLIB after January 1, 2015.
-rw-r--r--src/usr.bin/openssl/enc.c40
-rw-r--r--src/usr.bin/openssl/openssl.c6
2 files changed, 2 insertions, 44 deletions
diff --git a/src/usr.bin/openssl/enc.c b/src/usr.bin/openssl/enc.c
index b80a177cd8..9e330ce5cb 100644
--- a/src/usr.bin/openssl/enc.c
+++ b/src/usr.bin/openssl/enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: enc.c,v 1.27 2023/03/06 14:32:06 tb Exp $ */ 1/* $OpenBSD: enc.c,v 1.28 2023/06/11 05:45:20 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -80,9 +80,6 @@ static struct {
80 char *bufsize; 80 char *bufsize;
81 const EVP_CIPHER *cipher; 81 const EVP_CIPHER *cipher;
82 int debug; 82 int debug;
83#ifdef ZLIB
84 int do_zlib;
85#endif
86 int enc; 83 int enc;
87 char *hiv; 84 char *hiv;
88 char *hkey; 85 char *hkey;
@@ -287,14 +284,6 @@ static const struct option enc_options[] = {
287 .type = OPTION_FLAG, 284 .type = OPTION_FLAG,
288 .opt.flag = &cfg.verbose, 285 .opt.flag = &cfg.verbose,
289 }, 286 },
290#ifdef ZLIB
291 {
292 .name = "z",
293 .desc = "Perform zlib compression/decompression",
294 .type = OPTION_FLAG,
295 .opt.flag = &cfg.do_zlib,
296 },
297#endif
298 { 287 {
299 .name = NULL, 288 .name = NULL,
300 .type = OPTION_ARGV_FUNC, 289 .type = OPTION_ARGV_FUNC,
@@ -349,9 +338,6 @@ enc_main(int argc, char **argv)
349 int ret = 1, inl; 338 int ret = 1, inl;
350 unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH]; 339 unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH];
351 unsigned char salt[PKCS5_SALT_LEN]; 340 unsigned char salt[PKCS5_SALT_LEN];
352#ifdef ZLIB
353 BIO *bzl = NULL;
354#endif
355 EVP_CIPHER_CTX *ctx = NULL; 341 EVP_CIPHER_CTX *ctx = NULL;
356 const EVP_MD *dgst = NULL; 342 const EVP_MD *dgst = NULL;
357 BIO *in = NULL, *out = NULL, *b64 = NULL, *benc = NULL; 343 BIO *in = NULL, *out = NULL, *b64 = NULL, *benc = NULL;
@@ -374,20 +360,10 @@ enc_main(int argc, char **argv)
374 if (strcmp(pname, "base64") == 0) 360 if (strcmp(pname, "base64") == 0)
375 cfg.base64 = 1; 361 cfg.base64 = 1;
376 362
377#ifdef ZLIB
378 if (strcmp(pname, "zlib") == 0)
379 cfg.do_zlib = 1;
380#endif
381
382 cfg.cipher = EVP_get_cipherbyname(pname); 363 cfg.cipher = EVP_get_cipherbyname(pname);
383 364
384#ifdef ZLIB
385 if (!cfg.do_zlib && !cfg.base64 &&
386 cfg.cipher == NULL && strcmp(pname, "enc") != 0)
387#else
388 if (!cfg.base64 && cfg.cipher == NULL && 365 if (!cfg.base64 && cfg.cipher == NULL &&
389 strcmp(pname, "enc") != 0) 366 strcmp(pname, "enc") != 0)
390#endif
391 { 367 {
392 BIO_printf(bio_err, "%s is an unknown cipher\n", pname); 368 BIO_printf(bio_err, "%s is an unknown cipher\n", pname);
393 goto end; 369 goto end;
@@ -561,17 +537,6 @@ enc_main(int argc, char **argv)
561 rbio = in; 537 rbio = in;
562 wbio = out; 538 wbio = out;
563 539
564#ifdef ZLIB
565 if (do_zlib) {
566 if ((bzl = BIO_new(BIO_f_zlib())) == NULL)
567 goto end;
568 if (enc)
569 wbio = BIO_push(bzl, wbio);
570 else
571 rbio = BIO_push(bzl, rbio);
572 }
573#endif
574
575 if (cfg.base64) { 540 if (cfg.base64) {
576 if ((b64 = BIO_new(BIO_f_base64())) == NULL) 541 if ((b64 = BIO_new(BIO_f_base64())) == NULL)
577 goto end; 542 goto end;
@@ -787,9 +752,6 @@ enc_main(int argc, char **argv)
787 BIO_free_all(out); 752 BIO_free_all(out);
788 BIO_free(benc); 753 BIO_free(benc);
789 BIO_free(b64); 754 BIO_free(b64);
790#ifdef ZLIB
791 BIO_free(bzl);
792#endif
793 free(pass); 755 free(pass);
794 756
795 return (ret); 757 return (ret);
diff --git a/src/usr.bin/openssl/openssl.c b/src/usr.bin/openssl/openssl.c
index 51940fdf64..9e2ba54755 100644
--- a/src/usr.bin/openssl/openssl.c
+++ b/src/usr.bin/openssl/openssl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: openssl.c,v 1.33 2023/04/25 16:11:02 tb Exp $ */ 1/* $OpenBSD: openssl.c,v 1.34 2023/06/11 05:45:20 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -329,10 +329,6 @@ FUNCTION functions[] = {
329 { FUNC_TYPE_CIPHER, "sm4-ofb", enc_main }, 329 { FUNC_TYPE_CIPHER, "sm4-ofb", enc_main },
330 { FUNC_TYPE_CIPHER, "sm4-cfb", enc_main }, 330 { FUNC_TYPE_CIPHER, "sm4-cfb", enc_main },
331#endif 331#endif
332#ifdef ZLIB
333 { FUNC_TYPE_CIPHER, "zlib", enc_main },
334#endif
335
336 { 0, NULL, NULL } 332 { 0, NULL, NULL }
337}; 333};
338 334