summaryrefslogtreecommitdiff
path: root/bufaux.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-04-16 12:31:48 +1000
committerDamien Miller <djm@mindrot.org>2000-04-16 12:31:48 +1000
commit5f05637b0ef7058d3ab2ff385251f73dcc9cb5f7 (patch)
tree443665fb58916f33c2f346aa3284a444d3352311 /bufaux.c
parenta664e870f27e6dc2c73f393e95a229abc527e0e6 (diff)
- Reduce diff against OpenBSD source
- All OpenSSL includes are now unconditionally referenced as openssl/foo.h - Pick up formatting changes - Other minor changed (typecasts, etc) that I missed
Diffstat (limited to 'bufaux.c')
-rw-r--r--bufaux.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/bufaux.c b/bufaux.c
index b4d52270a..9ae5e9e61 100644
--- a/bufaux.c
+++ b/bufaux.c
@@ -17,17 +17,10 @@
17 */ 17 */
18 18
19#include "includes.h" 19#include "includes.h"
20RCSID("$Id: bufaux.c,v 1.11 2000/04/16 01:18:40 damien Exp $"); 20RCSID("$Id: bufaux.c,v 1.12 2000/04/16 02:31:50 damien Exp $");
21 21
22#include "ssh.h" 22#include "ssh.h"
23
24#ifdef HAVE_OPENSSL
25#include <openssl/bn.h> 23#include <openssl/bn.h>
26#endif
27#ifdef HAVE_SSL
28#include <ssl/bn.h>
29#endif
30
31#include "bufaux.h" 24#include "bufaux.h"
32#include "xmalloc.h" 25#include "xmalloc.h"
33#include "getput.h" 26#include "getput.h"
@@ -131,7 +124,7 @@ buffer_get_bignum2(Buffer *buffer, BIGNUM *value)
131/* 124/*
132 * Returns an integer from the buffer (4 bytes, msb first). 125 * Returns an integer from the buffer (4 bytes, msb first).
133 */ 126 */
134unsigned int 127unsigned int
135buffer_get_int(Buffer *buffer) 128buffer_get_int(Buffer *buffer)
136{ 129{
137 unsigned char buf[4]; 130 unsigned char buf[4];
@@ -142,7 +135,7 @@ buffer_get_int(Buffer *buffer)
142/* 135/*
143 * Stores an integer in the buffer in 4 bytes, msb first. 136 * Stores an integer in the buffer in 4 bytes, msb first.
144 */ 137 */
145void 138void
146buffer_put_int(Buffer *buffer, unsigned int value) 139buffer_put_int(Buffer *buffer, unsigned int value)
147{ 140{
148 char buf[4]; 141 char buf[4];
@@ -182,13 +175,13 @@ buffer_get_string(Buffer *buffer, unsigned int *length_ptr)
182/* 175/*
183 * Stores and arbitrary binary string in the buffer. 176 * Stores and arbitrary binary string in the buffer.
184 */ 177 */
185void 178void
186buffer_put_string(Buffer *buffer, const void *buf, unsigned int len) 179buffer_put_string(Buffer *buffer, const void *buf, unsigned int len)
187{ 180{
188 buffer_put_int(buffer, len); 181 buffer_put_int(buffer, len);
189 buffer_append(buffer, buf, len); 182 buffer_append(buffer, buf, len);
190} 183}
191void 184void
192buffer_put_cstring(Buffer *buffer, const char *s) 185buffer_put_cstring(Buffer *buffer, const char *s)
193{ 186{
194 buffer_put_string(buffer, s, strlen(s)); 187 buffer_put_string(buffer, s, strlen(s));
@@ -197,7 +190,7 @@ buffer_put_cstring(Buffer *buffer, const char *s)
197/* 190/*
198 * Returns a character from the buffer (0 - 255). 191 * Returns a character from the buffer (0 - 255).
199 */ 192 */
200int 193int
201buffer_get_char(Buffer *buffer) 194buffer_get_char(Buffer *buffer)
202{ 195{
203 char ch; 196 char ch;
@@ -208,7 +201,7 @@ buffer_get_char(Buffer *buffer)
208/* 201/*
209 * Stores a character in the buffer. 202 * Stores a character in the buffer.
210 */ 203 */
211void 204void
212buffer_put_char(Buffer *buffer, int value) 205buffer_put_char(Buffer *buffer, int value)
213{ 206{
214 char ch = value; 207 char ch = value;