]> andersk Git - openssh.git/blobdiff - bufaux.c
NOTE: This update changes the RSA key generation. *NEW RSA KEYS
[openssh.git] / bufaux.c
index 5853ee6003ddecd0218f0d54d4a1816f4e3a2061..2d20ad6db77a44e0401cc428a2f8259e8f2d84d7 100644 (file)
--- a/bufaux.c
+++ b/bufaux.c
@@ -37,7 +37,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: bufaux.c,v 1.14 2000/12/19 23:17:55 markus Exp $");
+RCSID("$OpenBSD: bufaux.c,v 1.16 2001/01/16 23:58:08 deraadt Exp $");
 
 #include "ssh.h"
 #include <openssl/bn.h>
@@ -90,7 +90,7 @@ buffer_get_bignum(Buffer *buffer, BIGNUM *value)
        bytes = (bits + 7) / 8;
        if (buffer_len(buffer) < bytes)
                fatal("buffer_get_bignum: input buffer too small");
-       bin = (u_char*) buffer_ptr(buffer);
+       bin = (u_char *) buffer_ptr(buffer);
        BN_bin2bn(bin, bytes, value);
        buffer_consume(buffer, bytes);
 
@@ -152,6 +152,14 @@ buffer_get_int(Buffer *buffer)
        return GET_32BIT(buf);
 }
 
+u_int64_t
+buffer_get_int64(Buffer *buffer)
+{
+       u_char buf[8];
+       buffer_get(buffer, (char *) buf, 8);
+       return GET_64BIT(buf);
+}
+
 /*
  * Stores an integer in the buffer in 4 bytes, msb first.
  */
@@ -163,6 +171,14 @@ buffer_put_int(Buffer *buffer, u_int value)
        buffer_append(buffer, buf, 4);
 }
 
+void
+buffer_put_int64(Buffer *buffer, u_int64_t value)
+{
+       char buf[8];
+       PUT_64BIT(buf, value);
+       buffer_append(buffer, buf, 8);
+}
+
 /*
  * Returns an arbitrary binary string from the buffer.  The string cannot
  * be longer than 256k.  The returned value points to memory allocated
This page took 0.041032 seconds and 4 git commands to generate.