summaryrefslogtreecommitdiff
path: root/ssh-dss.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-06-23 21:23:20 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-06-23 21:23:20 +0000
commit5c3855210ef20be5931d4b58f641d71bc3b203e8 (patch)
treede100fe07cedd57448d9d4bd5bd23fa602c408b7 /ssh-dss.c
parent836f0e9d9a847ad0510ff50b2bedc58e295e0913 (diff)
- deraadt@cvs.openbsd.org 2002/06/23 03:30:58
[scard.c ssh-dss.c ssh-rsa.c sshconnect.c sshconnect2.c sshd.c sshlogin.c sshpty.c] various KNF and %d for unsigned
Diffstat (limited to 'ssh-dss.c')
-rw-r--r--ssh-dss.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/ssh-dss.c b/ssh-dss.c
index 02403f550..dbf8465ba 100644
--- a/ssh-dss.c
+++ b/ssh-dss.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: ssh-dss.c,v 1.14 2002/02/28 15:46:33 markus Exp $"); 26RCSID("$OpenBSD: ssh-dss.c,v 1.15 2002/06/23 03:30:17 deraadt Exp $");
27 27
28#include <openssl/bn.h> 28#include <openssl/bn.h>
29#include <openssl/evp.h> 29#include <openssl/evp.h>
@@ -40,9 +40,7 @@ RCSID("$OpenBSD: ssh-dss.c,v 1.14 2002/02/28 15:46:33 markus Exp $");
40#define SIGBLOB_LEN (2*INTBLOB_LEN) 40#define SIGBLOB_LEN (2*INTBLOB_LEN)
41 41
42int 42int
43ssh_dss_sign( 43ssh_dss_sign(Key *key, u_char **sigp, u_int *lenp,
44 Key *key,
45 u_char **sigp, u_int *lenp,
46 u_char *data, u_int datalen) 44 u_char *data, u_int datalen)
47{ 45{
48 DSA_SIG *sig; 46 DSA_SIG *sig;
@@ -71,7 +69,7 @@ ssh_dss_sign(
71 rlen = BN_num_bytes(sig->r); 69 rlen = BN_num_bytes(sig->r);
72 slen = BN_num_bytes(sig->s); 70 slen = BN_num_bytes(sig->s);
73 if (rlen > INTBLOB_LEN || slen > INTBLOB_LEN) { 71 if (rlen > INTBLOB_LEN || slen > INTBLOB_LEN) {
74 error("bad sig size %d %d", rlen, slen); 72 error("bad sig size %u %u", rlen, slen);
75 DSA_SIG_free(sig); 73 DSA_SIG_free(sig);
76 return -1; 74 return -1;
77 } 75 }
@@ -104,9 +102,7 @@ ssh_dss_sign(
104 return 0; 102 return 0;
105} 103}
106int 104int
107ssh_dss_verify( 105ssh_dss_verify(Key *key, u_char *signature, u_int signaturelen,
108 Key *key,
109 u_char *signature, u_int signaturelen,
110 u_char *data, u_int datalen) 106 u_char *data, u_int datalen)
111{ 107{
112 DSA_SIG *sig; 108 DSA_SIG *sig;
@@ -151,7 +147,7 @@ ssh_dss_verify(
151 } 147 }
152 148
153 if (len != SIGBLOB_LEN) { 149 if (len != SIGBLOB_LEN) {
154 fatal("bad sigbloblen %d != SIGBLOB_LEN", len); 150 fatal("bad sigbloblen %u != SIGBLOB_LEN", len);
155 } 151 }
156 152
157 /* parse signature */ 153 /* parse signature */