projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rationalise ordering of authentication operations. Still some work to do,
[u/mdw/putty]
/
sshrsa.c
diff --git
a/sshrsa.c
b/sshrsa.c
index
e44dce8
..
324fbd1
100644
(file)
--- a/
sshrsa.c
+++ b/
sshrsa.c
@@
-43,9
+43,12
@@
int makekey(unsigned char *data, struct RSAKey *result,
unsigned char *p = data;
int i;
unsigned char *p = data;
int i;
- result->bits = 0;
- for (i=0; i<4; i++)
- result->bits = (result->bits << 8) + *p++;
+ if (result) {
+ result->bits = 0;
+ for (i=0; i<4; i++)
+ result->bits = (result->bits << 8) + *p++;
+ } else
+ p += 4;
/*
* order=0 means exponent then modulus (the keys sent by the
/*
* order=0 means exponent then modulus (the keys sent by the
@@
-54,12
+57,13
@@
int makekey(unsigned char *data, struct RSAKey *result,
*/
if (order == 0)
*/
if (order == 0)
- p += ssh1_read_bignum(p, &result->exponent);
- result->bytes = (((p[0] << 8) + p[1]) + 7) / 8;
+ p += ssh1_read_bignum(p, result ? &result->exponent : NULL);
+ if (result)
+ result->bytes = (((p[0] << 8) + p[1]) + 7) / 8;
if (keystr) *keystr = p+2;
if (keystr) *keystr = p+2;
- p += ssh1_read_bignum(p,
&result->modulus
);
+ p += ssh1_read_bignum(p,
result ? &result->modulus : NULL
);
if (order == 1)
if (order == 1)
- p += ssh1_read_bignum(p,
&result->exponent
);
+ p += ssh1_read_bignum(p,
result ? &result->exponent : NULL
);
return p - data;
}
return p - data;
}