-/* $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.
*
char *bufsize;
const EVP_CIPHER *cipher;
int debug;
-#ifdef ZLIB
- int do_zlib;
-#endif
int enc;
char *hiv;
char *hkey;
.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,
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;
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;
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;
BIO_free_all(out);
BIO_free(benc);
BIO_free(b64);
-#ifdef ZLIB
- BIO_free(bzl);
-#endif
free(pass);
return (ret);
-/* $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.
*
{ 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 }
};