From: tb Date: Sun, 11 Jun 2023 05:45:20 +0000 (+0000) Subject: Unifdef ZLIB X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d1c9819ce997d58ef9e38f293a38e790e9b4fa29;p=openbsd Unifdef ZLIB This is very dead code: the openssl app was never compiled with -DZLIB after January 1, 2015. --- diff --git a/usr.bin/openssl/enc.c b/usr.bin/openssl/enc.c index b80a177cd8a..9e330ce5cb5 100644 --- a/usr.bin/openssl/enc.c +++ b/usr.bin/openssl/enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: enc.c,v 1.27 2023/03/06 14:32:06 tb Exp $ */ +/* $OpenBSD: enc.c,v 1.28 2023/06/11 05:45:20 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -80,9 +80,6 @@ static struct { char *bufsize; const EVP_CIPHER *cipher; int debug; -#ifdef ZLIB - int do_zlib; -#endif int enc; char *hiv; char *hkey; @@ -287,14 +284,6 @@ static const struct option enc_options[] = { .type = OPTION_FLAG, .opt.flag = &cfg.verbose, }, -#ifdef ZLIB - { - .name = "z", - .desc = "Perform zlib compression/decompression", - .type = OPTION_FLAG, - .opt.flag = &cfg.do_zlib, - }, -#endif { .name = NULL, .type = OPTION_ARGV_FUNC, @@ -349,9 +338,6 @@ enc_main(int argc, char **argv) int ret = 1, inl; unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH]; unsigned char salt[PKCS5_SALT_LEN]; -#ifdef ZLIB - BIO *bzl = NULL; -#endif EVP_CIPHER_CTX *ctx = NULL; const EVP_MD *dgst = NULL; BIO *in = NULL, *out = NULL, *b64 = NULL, *benc = NULL; @@ -374,20 +360,10 @@ enc_main(int argc, char **argv) if (strcmp(pname, "base64") == 0) cfg.base64 = 1; -#ifdef ZLIB - if (strcmp(pname, "zlib") == 0) - cfg.do_zlib = 1; -#endif - cfg.cipher = EVP_get_cipherbyname(pname); -#ifdef ZLIB - if (!cfg.do_zlib && !cfg.base64 && - cfg.cipher == NULL && strcmp(pname, "enc") != 0) -#else if (!cfg.base64 && cfg.cipher == NULL && strcmp(pname, "enc") != 0) -#endif { BIO_printf(bio_err, "%s is an unknown cipher\n", pname); goto end; @@ -561,17 +537,6 @@ enc_main(int argc, char **argv) rbio = in; wbio = out; -#ifdef ZLIB - if (do_zlib) { - if ((bzl = BIO_new(BIO_f_zlib())) == NULL) - goto end; - if (enc) - wbio = BIO_push(bzl, wbio); - else - rbio = BIO_push(bzl, rbio); - } -#endif - if (cfg.base64) { if ((b64 = BIO_new(BIO_f_base64())) == NULL) goto end; @@ -787,9 +752,6 @@ enc_main(int argc, char **argv) BIO_free_all(out); BIO_free(benc); BIO_free(b64); -#ifdef ZLIB - BIO_free(bzl); -#endif free(pass); return (ret); diff --git a/usr.bin/openssl/openssl.c b/usr.bin/openssl/openssl.c index 51940fdf64f..9e2ba547558 100644 --- a/usr.bin/openssl/openssl.c +++ b/usr.bin/openssl/openssl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: openssl.c,v 1.33 2023/04/25 16:11:02 tb Exp $ */ +/* $OpenBSD: openssl.c,v 1.34 2023/06/11 05:45:20 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -329,10 +329,6 @@ FUNCTION functions[] = { { FUNC_TYPE_CIPHER, "sm4-ofb", enc_main }, { FUNC_TYPE_CIPHER, "sm4-cfb", enc_main }, #endif -#ifdef ZLIB - { FUNC_TYPE_CIPHER, "zlib", enc_main }, -#endif - { 0, NULL, NULL } };