forked from libssh2/libssh2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
md5: allow disabling old-style encrypted private keys at build-time
Before this patch, this happened at runtime when using an old (pre-3.0), FIPS-enabled OpenSSL backend. This patch makes it possible to disable this via the build-time option `LIBSSH2_NO_MD5_PEM`. Also: - make sure to exclude all MD5 internal APIs when both the above and `LIBSSH2_NO_MD5` are enabled. - fix tests to support build with`LIBSSH2_NO_MD5`, `LIBSSH2_NO_MD5_PEM` and `LIBSSH2_NO_3DES`. - add FIXME to apply this change to `os400qc3.*`. Old-style encrypted private keys require MD5 and they look like this: ``` -----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: AES-128-CBC,<MD5-hex> <base64> -----END RSA PRIVATE KEY----- ``` E.g.: `tests/key_rsa_encrypted` Ref: libssh2/www#20 Closes libssh2#1181
- Loading branch information
1 parent
49be84b
commit c0f788e
Showing
15 changed files
with
170 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* Copyright (C) Viktor Szakats | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
#define LIBSSH2_MD5_PEM LIBSSH2_MD5 | ||
|
||
#ifdef LIBSSH2_NO_MD5 | ||
#undef LIBSSH2_MD5 | ||
#define LIBSSH2_MD5 0 | ||
#endif | ||
|
||
#ifdef LIBSSH2_NO_MD5_PEM | ||
#undef LIBSSH2_MD5_PEM | ||
#define LIBSSH2_MD5_PEM 0 | ||
#endif | ||
|
||
#ifdef LIBSSH2_NO_HMAC_RIPEMD | ||
#undef LIBSSH2_HMAC_RIPEMD | ||
#define LIBSSH2_HMAC_RIPEMD 0 | ||
#endif | ||
|
||
#ifdef LIBSSH2_NO_DSA | ||
#undef LIBSSH2_DSA | ||
#define LIBSSH2_DSA 0 | ||
#endif | ||
|
||
#ifdef LIBSSH2_NO_RSA | ||
#undef LIBSSH2_RSA | ||
#define LIBSSH2_RSA 0 | ||
#endif | ||
|
||
#ifdef LIBSSH2_NO_RSA_SHA1 | ||
#undef LIBSSH2_RSA_SHA1 | ||
#define LIBSSH2_RSA_SHA1 0 | ||
#endif | ||
|
||
#ifdef LIBSSH2_NO_ECDSA | ||
#undef LIBSSH2_ECDSA | ||
#define LIBSSH2_ECDSA 0 | ||
#endif | ||
|
||
#ifdef LIBSSH2_NO_ED25519 | ||
#undef LIBSSH2_ED25519 | ||
#define LIBSSH2_ED25519 0 | ||
#endif | ||
|
||
#ifdef LIBSSH2_NO_AES_CTR | ||
#undef LIBSSH2_AES_CTR | ||
#define LIBSSH2_AES_CTR 0 | ||
#endif | ||
|
||
#ifdef LIBSSH2_NO_AES_CBC | ||
#undef LIBSSH2_AES_CBC | ||
#define LIBSSH2_AES_CBC 0 | ||
#endif | ||
|
||
#ifdef LIBSSH2_NO_BLOWFISH | ||
#undef LIBSSH2_BLOWFISH | ||
#define LIBSSH2_BLOWFISH 0 | ||
#endif | ||
|
||
#ifdef LIBSSH2_NO_RC4 | ||
#undef LIBSSH2_RC4 | ||
#define LIBSSH2_RC4 0 | ||
#endif | ||
|
||
#ifdef LIBSSH2_NO_CAST | ||
#undef LIBSSH2_CAST | ||
#define LIBSSH2_CAST 0 | ||
#endif | ||
|
||
#ifdef LIBSSH2_NO_3DES | ||
#undef LIBSSH2_3DES | ||
#define LIBSSH2_3DES 0 | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.