forked from proftpd/proftpd
-
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.
Merge pull request proftpd#1335 from proftpd/sftp-openssh-etm-issue1330
Issue proftpd#1330: Implement OpenSSH "Encrypt-Then-MAC" (ETM) algorithm ext…
- Loading branch information
Showing
9 changed files
with
1,450 additions
and
135 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,9 @@ ChangeLog files. | |
SFTPCiphers | ||
"[email protected]", "[email protected]" (Bug #3759) | ||
|
||
SFTPDigests | ||
"[email protected]", ... (Issue #1330) | ||
|
||
SFTPOptions NoHostkeyRotation | ||
|
||
|
||
|
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 |
---|---|---|
|
@@ -169,20 +169,28 @@ static struct sftp_digest digests[] = { | |
*/ | ||
#ifdef HAVE_SHA256_OPENSSL | ||
{ "hmac-sha2-256", "sha256", EVP_sha256, 0, TRUE, TRUE }, | ||
{ "[email protected]", "sha256", EVP_sha256, 0, TRUE, TRUE }, | ||
#endif /* SHA256 support in OpenSSL */ | ||
#ifdef HAVE_SHA512_OPENSSL | ||
{ "hmac-sha2-512", "sha512", EVP_sha512, 0, TRUE, TRUE }, | ||
{ "[email protected]", "sha512", EVP_sha512, 0, TRUE, TRUE }, | ||
#endif /* SHA512 support in OpenSSL */ | ||
{ "hmac-sha1", "sha1", EVP_sha1, 0, TRUE, TRUE }, | ||
{ "[email protected]", "sha1",EVP_sha1, 0, TRUE, TRUE }, | ||
{ "hmac-sha1-96", "sha1", EVP_sha1, 12, TRUE, TRUE }, | ||
{ "[email protected]", "sha1", EVP_sha1, 12, TRUE, TRUE }, | ||
{ "hmac-md5", "md5", EVP_md5, 0, FALSE, FALSE }, | ||
{ "[email protected]", "md5", EVP_md5, 0, FALSE, TRUE }, | ||
{ "hmac-md5-96", "md5", EVP_md5, 12, FALSE, FALSE }, | ||
{ "[email protected]", "md5", EVP_md5, 12, FALSE, TRUE }, | ||
#if !defined(OPENSSL_NO_RIPEMD) | ||
{ "hmac-ripemd160", "rmd160", EVP_ripemd160, 0, FALSE, FALSE }, | ||
#endif /* !OPENSSL_NO_RIPEMD */ | ||
#if OPENSSL_VERSION_NUMBER > 0x000907000L | ||
{ "[email protected]", NULL, NULL, 8, TRUE, FALSE }, | ||
{ "[email protected]", NULL, NULL, 8, TRUE, FALSE }, | ||
{ "[email protected]", NULL, NULL, 16, TRUE, FALSE }, | ||
{ "[email protected]", NULL, NULL, 16, TRUE, FALSE }, | ||
#endif /* OpenSSL-0.9.7 or later */ | ||
{ "none", "null", EVP_md_null, 0, FALSE, TRUE }, | ||
{ NULL, NULL, NULL, 0, FALSE, FALSE } | ||
|
@@ -1046,10 +1054,12 @@ const EVP_MD *sftp_crypto_get_digest(const char *name, uint32_t *mac_len) { | |
const EVP_MD *digest = NULL; | ||
|
||
#if OPENSSL_VERSION_NUMBER > 0x000907000L | ||
if (strncmp(name, "[email protected]", 12) == 0) { | ||
if (strcmp(name, "[email protected]") == 0 || | ||
strcmp(name, "[email protected]") == 0) { | ||
digest = get_umac64_digest(); | ||
|
||
} else if (strncmp(name, "[email protected]", 13) == 0) { | ||
} else if (strcmp(name, "[email protected]") == 0 || | ||
strcmp(name, "[email protected]") == 0) { | ||
digest = get_umac128_digest(); | ||
#else | ||
if (FALSE) { | ||
|
@@ -1237,16 +1247,18 @@ const char *sftp_crypto_get_kexinit_digest_list(pool *p) { | |
} | ||
#endif /* OPENSSL_FIPS */ | ||
|
||
if (strncmp(c->argv[i], "none", 5) != 0) { | ||
if (strcmp(c->argv[i], "none") != 0) { | ||
if (digests[j].openssl_name != NULL && | ||
EVP_get_digestbyname(digests[j].openssl_name) != NULL) { | ||
res = pstrcat(p, res, *res ? "," : "", | ||
pstrdup(p, digests[j].name), NULL); | ||
|
||
} else { | ||
/* The umac-64/umac-128 digests are special cases. */ | ||
if (strncmp(digests[j].name, "[email protected]", 12) == 0 || | ||
strncmp(digests[j].name, "[email protected]", 13) == 0) { | ||
if (strcmp(digests[j].name, "[email protected]") == 0 || | ||
strcmp(digests[j].name, "[email protected]") == 0 || | ||
strcmp(digests[j].name, "[email protected]") == 0 || | ||
strcmp(digests[j].name, "[email protected]") == 0) { | ||
res = pstrcat(p, res, *res ? "," : "", | ||
pstrdup(p, digests[j].name), NULL); | ||
|
||
|
@@ -1284,16 +1296,18 @@ const char *sftp_crypto_get_kexinit_digest_list(pool *p) { | |
} | ||
#endif /* OPENSSL_FIPS */ | ||
|
||
if (strncmp(digests[i].name, "none", 5) != 0) { | ||
if (strcmp(digests[i].name, "none") != 0) { | ||
if (digests[i].openssl_name != NULL && | ||
EVP_get_digestbyname(digests[i].openssl_name) != NULL) { | ||
res = pstrcat(p, res, *res ? "," : "", | ||
pstrdup(p, digests[i].name), NULL); | ||
|
||
} else { | ||
/* The umac-64/umac-128 digests are special cases. */ | ||
if (strncmp(digests[i].name, "[email protected]", 12) == 0 || | ||
strncmp(digests[i].name, "[email protected]", 13) == 0) { | ||
if (strcmp(digests[i].name, "[email protected]") == 0 || | ||
strcmp(digests[i].name, "[email protected]") == 0 || | ||
strcmp(digests[i].name, "[email protected]") == 0 || | ||
strcmp(digests[i].name, "[email protected]") == 0) { | ||
res = pstrcat(p, res, *res ? "," : "", | ||
pstrdup(p, digests[i].name), NULL); | ||
|
||
|
Oops, something went wrong.