Skip to content

Commit 03047e7

Browse files
committed
Deprecate Low Level Blowfish APIs
Applications should instead use the higher level EVP APIs, e.g. EVP_Encrypt*() and EVP_Decrypt*(). Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from #10740)
1 parent 339638b commit 03047e7

File tree

17 files changed

+133
-45
lines changed

17 files changed

+133
-45
lines changed

CHANGES

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99

1010
Changes between 1.1.1 and 3.0.0 [xx XXX xxxx]
1111

12+
*) All of the low level Blowfish functions have been deprecated including:
13+
BF_set_key, BF_encrypt, BF_decrypt, BF_ecb_encrypt, BF_cbc_encrypt,
14+
BF_cfb64_encrypt, BF_ofb64_encrypt, and BF_options.
15+
Use of these low level functions has been informally discouraged for a long
16+
time. Instead applications should use the high level EVP APIs, e.g.
17+
EVP_EncryptInit_ex, EVP_EncryptUpdate, EVP_EncryptFinal_ex, and the
18+
equivalently named decrypt functions.
19+
[Matt Caswell]
20+
1221
*) Removed include/openssl/opensslconf.h.in and replaced it with
1322
include/openssl/configuration.h.in, which differs in not including
1423
<openssl/macros.h>. A short header include/openssl/opensslconf.h

apps/speed.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ static const OPT_PAIR doit_choices[] = {
384384
{"seed-cbc", D_CBC_SEED},
385385
{"seed", D_CBC_SEED},
386386
#endif
387-
#ifndef OPENSSL_NO_BF
387+
#if !defined(OPENSSL_NO_BF) && !defined(OPENSSL_NO_DEPRECATED_3_0)
388388
{"bf-cbc", D_CBC_BF},
389389
{"blowfish", D_CBC_BF},
390390
{"bf", D_CBC_BF},
@@ -1461,7 +1461,7 @@ int speed_main(int argc, char **argv)
14611461
#ifndef OPENSSL_NO_SEED
14621462
SEED_KEY_SCHEDULE seed_ks;
14631463
#endif
1464-
#ifndef OPENSSL_NO_BF
1464+
#if !defined(OPENSSL_NO_BF) && !defined(OPENSSL_NO_DEPRECATED_3_0)
14651465
BF_KEY bf_ks;
14661466
#endif
14671467
#ifndef OPENSSL_NO_CAST
@@ -1986,7 +1986,7 @@ int speed_main(int argc, char **argv)
19861986
goto end;
19871987
}
19881988
#endif
1989-
#ifndef OPENSSL_NO_BF
1989+
#if !defined(OPENSSL_NO_BF) && !defined(OPENSSL_NO_DEPRECATED_3_0)
19901990
if (doit[D_CBC_BF])
19911991
BF_set_key(&bf_ks, 16, key16);
19921992
#endif
@@ -2650,7 +2650,7 @@ int speed_main(int argc, char **argv)
26502650
}
26512651
}
26522652
#endif
2653-
#ifndef OPENSSL_NO_BF
2653+
#if !defined(OPENSSL_NO_BF) && !defined(OPENSSL_NO_DEPRECATED_3_0)
26542654
if (doit[D_CBC_BF]) {
26552655
if (async_jobs > 0) {
26562656
BIO_printf(bio_err, "Async mode is not supported with %s\n",
@@ -3502,7 +3502,7 @@ int speed_main(int argc, char **argv)
35023502
#ifndef OPENSSL_NO_IDEA
35033503
printf("%s ", IDEA_options());
35043504
#endif
3505-
#ifndef OPENSSL_NO_BF
3505+
#if !defined(OPENSSL_NO_BF) && !defined(OPENSSL_NO_DEPRECATED_3_0)
35063506
printf("%s ", BF_options());
35073507
#endif
35083508
printf("\n%s\n", OpenSSL_version(OPENSSL_CFLAGS));

apps/version.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@ int version_main(int argc, char **argv)
140140
#endif
141141
#ifndef OPENSSL_NO_IDEA
142142
printf(" %s", IDEA_options());
143-
#endif
144-
#ifndef OPENSSL_NO_BF
145-
printf(" %s", BF_options());
146143
#endif
147144
printf("\n");
148145
}

crypto/bf/bf_cfb64.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10+
/*
11+
* BF low level APIs are deprecated for public use, but still ok for internal
12+
* use.
13+
*/
14+
#include "internal/deprecated.h"
15+
1016
#include <openssl/blowfish.h>
1117
#include "bf_local.h"
1218

crypto/bf/bf_ecb.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10+
/*
11+
* BF low level APIs are deprecated for public use, but still ok for internal
12+
* use.
13+
*/
14+
#include "internal/deprecated.h"
15+
1016
#include <openssl/blowfish.h>
1117
#include "bf_local.h"
1218
#include <openssl/opensslv.h>

crypto/bf/bf_enc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10+
/*
11+
* BF low level APIs are deprecated for public use, but still ok for internal
12+
* use.
13+
*/
14+
#include "internal/deprecated.h"
15+
1016
#include <openssl/blowfish.h>
1117
#include "bf_local.h"
1218

crypto/bf/bf_ofb64.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10+
/*
11+
* BF low level APIs are deprecated for public use, but still ok for internal
12+
* use.
13+
*/
14+
#include "internal/deprecated.h"
15+
1016
#include <openssl/blowfish.h>
1117
#include "bf_local.h"
1218

crypto/bf/bf_skey.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10+
/*
11+
* BF low level APIs are deprecated for public use, but still ok for internal
12+
* use.
13+
*/
14+
#include "internal/deprecated.h"
15+
1016
#include <stdio.h>
1117
#include <string.h>
1218
#include <openssl/blowfish.h>

crypto/evp/e_bf.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10+
/*
11+
* BF low level APIs are deprecated for public use, but still ok for internal
12+
* use.
13+
*/
14+
#include "internal/deprecated.h"
15+
1016
#include <stdio.h>
1117
#include "internal/cryptlib.h"
1218
#ifndef OPENSSL_NO_BF

doc/man3/BF_encrypt.pod

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ BF_cfb64_encrypt, BF_ofb64_encrypt, BF_options - Blowfish encryption
99

1010
#include <openssl/blowfish.h>
1111

12+
Deprecated since OpenSSL 3.0, can be hidden entirely by defining
13+
B<OPENSSL_API_COMPAT> with a suitable version value, see
14+
L<openssl_user_macros(7)>:
15+
1216
void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
1317

1418
void BF_ecb_encrypt(const unsigned char *in, unsigned char *out,
@@ -29,6 +33,10 @@ BF_cfb64_encrypt, BF_ofb64_encrypt, BF_options - Blowfish encryption
2933

3034
=head1 DESCRIPTION
3135

36+
All of the functions described on this page are deprecated. Applications should
37+
instead use L<EVP_EncryptInit_ex(3)>, L<EVP_EncryptUpdate(3)> and
38+
L<EVP_EncryptFinal_ex(3)> or the equivalently named decrypt functions.
39+
3240
This library implements the Blowfish cipher, which was invented and described
3341
by Counterpane (see http://www.counterpane.com/blowfish.html ).
3442

@@ -107,6 +115,10 @@ functions directly.
107115
L<EVP_EncryptInit(3)>,
108116
L<des_modes(7)>
109117

118+
=head1 HISTORY
119+
120+
All of these functions were deprecated in OpenSSL 3.0.
121+
110122
=head1 COPYRIGHT
111123

112124
Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.

0 commit comments

Comments
 (0)