- deraadt@cvs.openbsd.org 2002/06/23 09:39:55
[ssh-keygen.c]
u_int stuff
+ - deraadt@cvs.openbsd.org 2002/06/23 09:46:51
+ [bufaux.c servconf.c]
+ minor KNF. things the fingers do while you read
20020623
- (stevesk) [configure.ac] bug #255 LOGIN_NEEDS_UTMPX for AIX.
*/
#include "includes.h"
-RCSID("$OpenBSD: bufaux.c,v 1.25 2002/04/20 09:14:58 markus Exp $");
+RCSID("$OpenBSD: bufaux.c,v 1.26 2002/06/23 09:46:51 deraadt Exp $");
#include <openssl/bn.h>
#include "bufaux.h"
u_char *buf = xmalloc(bytes);
int oi;
int hasnohigh = 0;
+
buf[0] = '\0';
/* Get the value of in binary */
oi = BN_bn2bin(value, buf+1);
/**XXX should be two's-complement */
int len;
u_char *bin = buffer_get_string(buffer, (u_int *)&len);
+
BN_bin2bn(bin, len, value);
xfree(bin);
}
buffer_get_short(Buffer *buffer)
{
u_char buf[2];
+
buffer_get(buffer, (char *) buf, 2);
return GET_16BIT(buf);
}
buffer_get_int(Buffer *buffer)
{
u_char buf[4];
+
buffer_get(buffer, (char *) buf, 4);
return GET_32BIT(buf);
}
buffer_get_int64(Buffer *buffer)
{
u_char buf[8];
+
buffer_get(buffer, (char *) buf, 8);
return GET_64BIT(buf);
}
buffer_put_short(Buffer *buffer, u_short value)
{
char buf[2];
+
PUT_16BIT(buf, value);
buffer_append(buffer, buf, 2);
}
buffer_put_int(Buffer *buffer, u_int value)
{
char buf[4];
+
PUT_32BIT(buf, value);
buffer_append(buffer, buf, 4);
}
buffer_put_int64(Buffer *buffer, u_int64_t value)
{
char buf[8];
+
PUT_64BIT(buf, value);
buffer_append(buffer, buf, 8);
}
void *
buffer_get_string(Buffer *buffer, u_int *length_ptr)
{
- u_int len;
u_char *value;
+ u_int len;
+
/* Get the length. */
len = buffer_get_int(buffer);
if (len > 256 * 1024)
buffer_get_char(Buffer *buffer)
{
char ch;
+
buffer_get(buffer, &ch, 1);
return (u_char) ch;
}
buffer_put_char(Buffer *buffer, int value)
{
char ch = value;
+
buffer_append(buffer, &ch, 1);
}
*/
#include "includes.h"
-RCSID("$OpenBSD: servconf.c,v 1.111 2002/06/20 23:05:55 markus Exp $");
+RCSID("$OpenBSD: servconf.c,v 1.112 2002/06/23 09:46:51 deraadt Exp $");
#if defined(KRB4)
#include <krb.h>
hints.ai_family = IPv4or6;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = (addr == NULL) ? AI_PASSIVE : 0;
- snprintf(strport, sizeof strport, "%d", port);
+ snprintf(strport, sizeof strport, "%u", port);
if ((gaierr = getaddrinfo(addr, strport, &hints, &aitop)) != 0)
fatal("bad addr or host: %s (%s)",
addr ? addr : "<NULL>",
const char *filename, int linenum)
{
char *cp, **charptr, *arg, *p;
- int *intptr, value;
+ int *intptr, value, i, n;
ServerOpCodes opcode;
- int i, n;
cp = line;
arg = strdelim(&cp);
if (options->num_allow_users >= MAX_ALLOW_USERS)
fatal("%s line %d: too many allow users.",
filename, linenum);
- options->allow_users[options->num_allow_users++] = xstrdup(arg);
+ options->allow_users[options->num_allow_users++] =
+ xstrdup(arg);
}
break;
if (options->num_deny_users >= MAX_DENY_USERS)
fatal( "%s line %d: too many deny users.",
filename, linenum);
- options->deny_users[options->num_deny_users++] = xstrdup(arg);
+ options->deny_users[options->num_deny_users++] =
+ xstrdup(arg);
}
break;
if (options->num_allow_groups >= MAX_ALLOW_GROUPS)
fatal("%s line %d: too many allow groups.",
filename, linenum);
- options->allow_groups[options->num_allow_groups++] = xstrdup(arg);
+ options->allow_groups[options->num_allow_groups++] =
+ xstrdup(arg);
}
break;
void
read_server_config(ServerOptions *options, const char *filename)
{
- FILE *f;
+ int linenum, bad_options = 0;
char line[1024];
- int linenum;
- int bad_options = 0;
+ FILE *f;
f = fopen(filename, "r");
if (!f) {