=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/Attic/bufaux.c,v retrieving revision 1.20 retrieving revision 1.23 diff -u -r1.20 -r1.23 --- src/usr.bin/ssh/Attic/bufaux.c 2001/12/19 17:16:13 1.20 +++ src/usr.bin/ssh/Attic/bufaux.c 2002/03/18 17:25:29 1.23 @@ -37,7 +37,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: bufaux.c,v 1.20 2001/12/19 17:16:13 stevesk Exp $"); +RCSID("$OpenBSD: bufaux.c,v 1.23 2002/03/18 17:25:29 provos Exp $"); #include #include "bufaux.h" @@ -77,7 +77,7 @@ /* * Retrieves an BIGNUM from the buffer. */ -int +void buffer_get_bignum(Buffer *buffer, BIGNUM *value) { int bits, bytes; @@ -90,11 +90,9 @@ bytes = (bits + 7) / 8; if (buffer_len(buffer) < bytes) fatal("buffer_get_bignum: input buffer too small"); - bin = (u_char *) buffer_ptr(buffer); + bin = buffer_ptr(buffer); BN_bin2bn(bin, bytes, value); buffer_consume(buffer, bytes); - - return 2 + bytes; } /* @@ -130,15 +128,14 @@ xfree(buf); } -int +void buffer_get_bignum2(Buffer *buffer, BIGNUM *value) { /**XXX should be two's-complement */ int len; - u_char *bin = (u_char *)buffer_get_string(buffer, (u_int *)&len); + u_char *bin = buffer_get_string(buffer, (u_int *)&len); BN_bin2bn(bin, len, value); xfree(bin); - return len; } /* @@ -220,6 +217,8 @@ void buffer_put_cstring(Buffer *buffer, const char *s) { + if (s == NULL) + fatal("buffer_put_cstring: s == NULL"); buffer_put_string(buffer, s, strlen(s)); }