Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
5d31fc6
Host Key RSA 256/512 support #536
Aug 30, 2021
b10ccc7
Host Key RSA 256/512 support libssh2 #536
Aug 30, 2021
33e98c4
Remove unnecessary code
Aug 30, 2021
f8db95b
formatting
Sep 2, 2021
428c54c
Client side key hash upgrading for RFC 8332
Nov 8, 2021
6427e9f
style points
Nov 8, 2021
26c3ce1
don’t use memmem
Nov 8, 2021
3841799
more ci building fixes
Nov 8, 2021
9267a1a
CI fixes
Nov 8, 2021
4ec7ca7
made _libssh2_supported_key_sign_algorithms() const
Nov 8, 2021
2cee98c
ci build warning
Nov 8, 2021
10beabd
updated docs
Nov 8, 2021
9d1a3a5
Added missing ext-info-c to commit
Nov 9, 2021
7e5b537
added rsa-sha2-256/512 rsa key init support
Nov 30, 2021
2b48eaf
formatting
Nov 30, 2021
d007d4d
making style checker happy, maybe
Nov 30, 2021
63805b9
support encrypt-then-mac (etm) MACs
palmin Dec 25, 2021
274c6f1
Merge branch 'master' into encrypt-then-mac
palmin Apr 5, 2022
5a1dde0
Merge remote-tracking branch 'upstream/master' into encrypt-then-mac
palmin Nov 17, 2022
24c9f2c
Merge remote-tracking branch 'upstream/master' into encrypt-then-mac2
palmin Mar 7, 2023
5f1dfac
read tests for sha1-etm, sha2-256-etm & sha2-512-etm
palmin Mar 7, 2023
b307169
fix tests of allocation failure
palmin Mar 7, 2023
068b1ad
remove extra function definition in wincng.c
palmin Mar 7, 2023
8cceffb
remove unused variable in _LIBSSH2_SESSION
palmin Mar 7, 2023
8c4780e
satisfy style checks
palmin Mar 7, 2023
b5b2f32
Merge remote-tracking branch 'upstream/master' into encrypt-then-mac
palmin Mar 7, 2023
f886987
satisfy style checks
palmin Mar 7, 2023
6ac7258
fix c99 errors
palmin Mar 7, 2023
11e846e
fix cmake MAC tests
palmin Mar 8, 2023
05910ba
Merge remote-tracking branch 'upstream/master' into encrypt-then-mac
palmin Mar 14, 2023
5d2a715
_libssh2_debug is called with single argument
palmin Mar 14, 2023
985bd15
fix tests after merge
palmin Mar 14, 2023
7c43d58
fix name when testing etm MACs
palmin Mar 14, 2023
a420005
Merge remote-tracking branch 'upstream/master' into encrypt-then-mac
palmin Mar 20, 2023
83d9328
Merge branch 'master' into encrypt-then-mac
vszakats Apr 11, 2023
22413f3
Merge branch 'master' into encrypt-then-mac
vszakats Apr 15, 2023
f6412ce
refix
vszakats Apr 15, 2023
479c40a
indent
vszakats Apr 15, 2023
ec41861
eol
vszakats Apr 15, 2023
bdec37c
checksrc
vszakats Apr 15, 2023
226f5d2
checksrc
vszakats Apr 15, 2023
d5e7f5d
fix shadow warning
vszakats Apr 15, 2023
d5bd4c1
realign
vszakats Apr 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/libssh2_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,8 @@ struct transportpacket
packet_length + padding_length + 4 +
mac_length. */
unsigned char *payload; /* this is a pointer to a LIBSSH2_ALLOC()
area to which we write decrypted data */
area to which we write incoming packet data
which is not yet decrypted in etm mode. */
unsigned char *wptr; /* write pointer into the payload to where we
are currently writing decrypted data */

Expand Down
48 changes: 45 additions & 3 deletions src/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ static LIBSSH2_MAC_METHOD mac_method_none = {
0,
NULL,
mac_none_MAC,
NULL
NULL,
0
};
#endif /* defined(LIBSSH2DEBUG) && defined(LIBSSH2_MAC_NONE_INSECURE) */

Expand Down Expand Up @@ -138,16 +139,26 @@ mac_method_hmac_sha2_512_hash(LIBSSH2_SESSION * session,
return 0;
}



static const LIBSSH2_MAC_METHOD mac_method_hmac_sha2_512 = {
"hmac-sha2-512",
64,
64,
mac_method_common_init,
mac_method_hmac_sha2_512_hash,
mac_method_common_dtor,
0
};

static const LIBSSH2_MAC_METHOD mac_method_hmac_sha2_512_etm = {
"[email protected]",
64,
64,
mac_method_common_init,
mac_method_hmac_sha2_512_hash,
mac_method_common_dtor,
1
};

#endif


Expand Down Expand Up @@ -192,7 +203,19 @@ static const LIBSSH2_MAC_METHOD mac_method_hmac_sha2_256 = {
mac_method_common_init,
mac_method_hmac_sha2_256_hash,
mac_method_common_dtor,
0
};

static const LIBSSH2_MAC_METHOD mac_method_hmac_sha2_256_etm = {
"[email protected]",
32,
32,
mac_method_common_init,
mac_method_hmac_sha2_256_hash,
mac_method_common_dtor,
1
};

#endif


Expand Down Expand Up @@ -237,6 +260,17 @@ static const LIBSSH2_MAC_METHOD mac_method_hmac_sha1 = {
mac_method_common_init,
mac_method_hmac_sha1_hash,
mac_method_common_dtor,
0
};

static const LIBSSH2_MAC_METHOD mac_method_hmac_sha1_etm = {
"[email protected]",
20,
20,
mac_method_common_init,
mac_method_hmac_sha1_hash,
mac_method_common_dtor,
1
};

/* mac_method_hmac_sha1_96_hash
Expand Down Expand Up @@ -268,6 +302,7 @@ static const LIBSSH2_MAC_METHOD mac_method_hmac_sha1_96 = {
mac_method_common_init,
mac_method_hmac_sha1_96_hash,
mac_method_common_dtor,
0
};

#if LIBSSH2_MD5
Expand Down Expand Up @@ -310,6 +345,7 @@ static const LIBSSH2_MAC_METHOD mac_method_hmac_md5 = {
mac_method_common_init,
mac_method_hmac_md5_hash,
mac_method_common_dtor,
0
};

/* mac_method_hmac_md5_96_hash
Expand Down Expand Up @@ -339,6 +375,7 @@ static const LIBSSH2_MAC_METHOD mac_method_hmac_md5_96 = {
mac_method_common_init,
mac_method_hmac_md5_96_hash,
mac_method_common_dtor,
0
};
#endif /* LIBSSH2_MD5 */

Expand Down Expand Up @@ -383,6 +420,7 @@ static const LIBSSH2_MAC_METHOD mac_method_hmac_ripemd160 = {
mac_method_common_init,
mac_method_hmac_ripemd160_hash,
mac_method_common_dtor,
0
};

static const LIBSSH2_MAC_METHOD mac_method_hmac_ripemd160_openssh_com = {
Expand All @@ -392,17 +430,21 @@ static const LIBSSH2_MAC_METHOD mac_method_hmac_ripemd160_openssh_com = {
mac_method_common_init,
mac_method_hmac_ripemd160_hash,
mac_method_common_dtor,
0
};
#endif /* LIBSSH2_HMAC_RIPEMD */

static const LIBSSH2_MAC_METHOD *mac_methods[] = {
#if LIBSSH2_HMAC_SHA256
&mac_method_hmac_sha2_256,
&mac_method_hmac_sha2_256_etm,
#endif
#if LIBSSH2_HMAC_SHA512
&mac_method_hmac_sha2_512,
&mac_method_hmac_sha2_512_etm,
#endif
&mac_method_hmac_sha1,
&mac_method_hmac_sha1_etm,
&mac_method_hmac_sha1_96,
#if LIBSSH2_MD5
&mac_method_hmac_md5,
Expand Down
2 changes: 2 additions & 0 deletions src/mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ struct _LIBSSH2_MAC_METHOD
size_t packet_len, const unsigned char *addtl,
size_t addtl_len, void **abstract);
int (*dtor) (LIBSSH2_SESSION * session, void **abstract);

int etm; /* encrypt-then-mac */
};

typedef struct _LIBSSH2_MAC_METHOD LIBSSH2_MAC_METHOD;
Expand Down
Loading