version 1.12, 2000/02/16 13:18:51 |
version 1.13, 2000/02/18 10:20:20 |
|
|
#include "ssh.h" |
#include "ssh.h" |
|
|
/* |
/* |
* Reads a multiple-precision integer in hex from the buffer, and advances |
* Reads a multiple-precision integer in decimal from the buffer, and advances |
* the pointer. The integer must already be initialized. This function is |
* the pointer. The integer must already be initialized. This function is |
* permitted to modify the buffer. This leaves *cpp to point just beyond the |
* permitted to modify the buffer. This leaves *cpp to point just beyond the |
* last processed (and maybe modified) character. Note that this may modify |
* last processed (and maybe modified) character. Note that this may modify |
|
|
auth_rsa_read_bignum(char **cpp, BIGNUM * value) |
auth_rsa_read_bignum(char **cpp, BIGNUM * value) |
{ |
{ |
char *cp = *cpp; |
char *cp = *cpp; |
int len, old; |
int old; |
|
|
/* Skip any leading whitespace. */ |
/* Skip any leading whitespace. */ |
for (; *cp == ' ' || *cp == '\t'; cp++) |
for (; *cp == ' ' || *cp == '\t'; cp++) |
; |
; |
|
|
/* Check that it begins with a hex digit. */ |
/* Check that it begins with a decimal digit. */ |
if (*cp < '0' || *cp > '9') |
if (*cp < '0' || *cp > '9') |
return 0; |
return 0; |
|
|
/* Save starting position. */ |
/* Save starting position. */ |
*cpp = cp; |
*cpp = cp; |
|
|
/* Move forward until all hex digits skipped. */ |
/* Move forward until all decimal digits skipped. */ |
for (; *cp >= '0' && *cp <= '9'; cp++) |
for (; *cp >= '0' && *cp <= '9'; cp++) |
; |
; |
|
|
/* Compute the length of the hex number. */ |
|
len = cp - *cpp; |
|
|
|
/* Save the old terminating character, and replace it by \0. */ |
/* Save the old terminating character, and replace it by \0. */ |
old = *cp; |
old = *cp; |