diff options
author | Damien Miller <djm@mindrot.org> | 1999-11-25 00:26:21 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 1999-11-25 00:26:21 +1100 |
commit | 95def09838fc61b37b6ea7cd5c234a465b4b129b (patch) | |
tree | 042744f76f40a326b873cb1c3690a6d7d966bc3e /fingerprint.c | |
parent | 4d2f15f895f4c795afc008aeff3fd2ceffbc44f4 (diff) |
- Merged very large OpenBSD source code reformat
- OpenBSD CVS updates
- [channels.c cipher.c compat.c log-client.c scp.c serverloop.c]
[ssh.h sshd.8 sshd.c]
syslog changes:
* Unified Logmessage for all auth-types, for success and for failed
* Standard connections get only ONE line in the LOG when level==LOG:
Auth-attempts are logged only, if authentication is:
a) successfull or
b) with passwd or
c) we had more than AUTH_FAIL_LOG failues
* many log() became verbose()
* old behaviour with level=VERBOSE
- [readconf.c readconf.h ssh.1 ssh.h sshconnect.c sshd.c]
tranfer s/key challenge/response data in SSH_SMSG_AUTH_TIS_CHALLENGE
messages. allows use of s/key in windows (ttssh, securecrt) and
ssh-1.2.27 clients without 'ssh -v', ok: niels@
- [sshd.8]
-V, for fallback to openssh in SSH2 compatibility mode
- [sshd.c]
fix sigchld race; cjc5@po.cwru.edu
Diffstat (limited to 'fingerprint.c')
-rw-r--r-- | fingerprint.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/fingerprint.c b/fingerprint.c index 9a9b63583..54fc7e9b0 100644 --- a/fingerprint.c +++ b/fingerprint.c | |||
@@ -1,5 +1,5 @@ | |||
1 | #include "includes.h" | 1 | #include "includes.h" |
2 | RCSID("$Id: fingerprint.c,v 1.1 1999/11/17 06:29:08 damien Exp $"); | 2 | RCSID("$Id: fingerprint.c,v 1.3 1999/11/24 00:26:01 deraadt Exp $"); |
3 | 3 | ||
4 | #include "ssh.h" | 4 | #include "ssh.h" |
5 | #include "xmalloc.h" | 5 | #include "xmalloc.h" |
@@ -13,17 +13,18 @@ RCSID("$Id: fingerprint.c,v 1.1 1999/11/17 06:29:08 damien Exp $"); | |||
13 | 13 | ||
14 | #define FPRINT "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x" | 14 | #define FPRINT "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x" |
15 | 15 | ||
16 | /* Generate key fingerprint in ascii format. | 16 | /* |
17 | Based on ideas and code from Bjoern Groenvall <bg@sics.se> */ | 17 | * Generate key fingerprint in ascii format. |
18 | 18 | * Based on ideas and code from Bjoern Groenvall <bg@sics.se> | |
19 | */ | ||
19 | char * | 20 | char * |
20 | fingerprint(BIGNUM *e, BIGNUM *n) | 21 | fingerprint(BIGNUM *e, BIGNUM *n) |
21 | { | 22 | { |
22 | static char retval[80]; | 23 | static char retval[80]; |
23 | MD5_CTX md; | 24 | MD5_CTX md; |
24 | unsigned char d[16]; | 25 | unsigned char d[16]; |
25 | char *buf; | 26 | char *buf; |
26 | int nlen, elen; | 27 | int nlen, elen; |
27 | 28 | ||
28 | nlen = BN_num_bytes(n); | 29 | nlen = BN_num_bytes(n); |
29 | elen = BN_num_bytes(e); | 30 | elen = BN_num_bytes(e); |
@@ -37,8 +38,8 @@ fingerprint(BIGNUM *e, BIGNUM *n) | |||
37 | MD5_Update(&md, buf, nlen + elen); | 38 | MD5_Update(&md, buf, nlen + elen); |
38 | MD5_Final(d, &md); | 39 | MD5_Final(d, &md); |
39 | snprintf(retval, sizeof(retval), FPRINT, | 40 | snprintf(retval, sizeof(retval), FPRINT, |
40 | d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], | 41 | d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], |
41 | d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]); | 42 | d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]); |
42 | memset(buf, 0, nlen + elen); | 43 | memset(buf, 0, nlen + elen); |
43 | xfree(buf); | 44 | xfree(buf); |
44 | return retval; | 45 | return retval; |