projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Instructions on setting PATH more permanently.
[u/mdw/putty]
/
sshsha.c
diff --git
a/sshsha.c
b/sshsha.c
index
d47b1be
..
48cabb5
100644
(file)
--- a/
sshsha.c
+++ b/
sshsha.c
@@
-7,8
+7,6
@@
#include "ssh.h"
#include "ssh.h"
-typedef unsigned int uint32;
-
/* ----------------------------------------------------------------------
* Core SHA algorithm: processes 16-word blocks into a message digest.
*/
/* ----------------------------------------------------------------------
* Core SHA algorithm: processes 16-word blocks into a message digest.
*/
@@
-201,6
+199,14
@@
static void sha1_sckey(unsigned char *key) {
sha1_key(&sha1_sc_mac_s1, &sha1_sc_mac_s2, key, 20);
}
sha1_key(&sha1_sc_mac_s1, &sha1_sc_mac_s2, key, 20);
}
+static void sha1_cskey_buggy(unsigned char *key) {
+ sha1_key(&sha1_cs_mac_s1, &sha1_cs_mac_s2, key, 16);
+}
+
+static void sha1_sckey_buggy(unsigned char *key) {
+ sha1_key(&sha1_sc_mac_s1, &sha1_sc_mac_s2, key, 16);
+}
+
static void sha1_do_hmac(SHA_State *s1, SHA_State *s2,
unsigned char *blk, int len, unsigned long seq,
unsigned char *hmac) {
static void sha1_do_hmac(SHA_State *s1, SHA_State *s2,
unsigned char *blk, int len, unsigned long seq,
unsigned char *hmac) {
@@
-238,3
+244,11
@@
struct ssh_mac ssh_sha1 = {
"hmac-sha1",
20
};
"hmac-sha1",
20
};
+
+struct ssh_mac ssh_sha1_buggy = {
+ sha1_cskey_buggy, sha1_sckey_buggy,
+ sha1_generate,
+ sha1_verify,
+ "hmac-sha1",
+ 20
+};