upstream: Replace all remaining instances of u_intXX_t types with the

C99 equivalent uintXX_t types.  ok djm@

OpenBSD-Commit-ID: d9b81151266adb129574ce268af49f14ac23e65b
This commit is contained in:
dtucker@openbsd.org authored and Darren Tucker committed 2026-03-03 21:04:04 +11:00
1 parent bb781f02d4
commit 2a387ba374
49 files changed
+485 -485

No files matched your search

+2 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: addr.c,v 1.9 2024/10/18 04:30:09 djm Exp $ */
/* $OpenBSD: addr.c,v 1.10 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2004-2008 Damien Miller <djm@mindrot.org>
@@ -61,7 +61,7 @@ masklen_valid(int af, u_int masklen)
static int
addr_xaddr_to_sa(const struct xaddr *xa, struct sockaddr *sa, socklen_t *len,
u_int16_t port)
uint16_t port)
{
struct sockaddr_in *in4 = (struct sockaddr_in *)sa;
struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)sa;
+4 -4
View File
@@ -27,11 +27,11 @@ struct xaddr {
union {
struct in_addr v4;
struct in6_addr v6;
u_int8_t addr8[16];
u_int16_t addr16[8];
u_int32_t addr32[4];
uint8_t addr8[16];
uint16_t addr16[8];
uint32_t addr32[4];
} xa; /* 128-bit address */
u_int32_t scope_id; /* iface scope id for v6 */
uint32_t scope_id; /* iface scope id for v6 */
#define v4 xa.v4
#define v6 xa.v6
#define addr8 xa.addr8
+3 -3
View File
@@ -90,7 +90,7 @@ extern void aug_save_egid(gid_t);
extern void aug_save_pid(pid_t);
extern void aug_save_asid(au_asid_t);
extern void aug_save_tid(dev_t, unsigned int);
extern void aug_save_tid_ex(dev_t, u_int32_t *, u_int32_t);
extern void aug_save_tid_ex(dev_t, uint32_t *, uint32_t);
extern int aug_save_me(void);
extern int aug_save_namask(void);
extern void aug_save_event(au_event_t);
@@ -129,10 +129,10 @@ static AuditInfoTermID ssh_bsm_tid;
* getaudit_addr() is only present on IPv6 capable machines.
*/
#if defined(HAVE_AUG_GET_MACHINE) || !defined(HAVE_GETAUDIT_ADDR)
extern int aug_get_machine(char *, u_int32_t *, u_int32_t *);
extern int aug_get_machine(char *, uint32_t *, uint32_t *);
#else
static int
aug_get_machine(char *host, u_int32_t *addr, u_int32_t *type)
aug_get_machine(char *host, uint32_t *addr, uint32_t *type)
{
struct addrinfo *ai;
struct sockaddr_in *in4;
+3 -3
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: auth2-chall.c,v 1.59 2026/02/06 22:59:18 dtucker Exp $ */
/* $OpenBSD: auth2-chall.c,v 1.60 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2001 Per Allansson. All rights reserved.
@@ -51,7 +51,7 @@ extern ServerOptions options;
static int auth2_challenge_start(struct ssh *);
static int send_userauth_info_request(struct ssh *);
static int input_userauth_info_response(int, u_int32_t, struct ssh *);
static int input_userauth_info_response(int, uint32_t, struct ssh *);
#ifdef BSD_AUTH
extern KbdintDevice mm_bsdauth_device;
@@ -291,7 +291,7 @@ send_userauth_info_request(struct ssh *ssh)
}
static int
input_userauth_info_response(int type, u_int32_t seq, struct ssh *ssh)
input_userauth_info_response(int type, uint32_t seq, struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
KbdintAuthctxt *kbdintctxt;
+9 -9
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: auth2-gss.c,v 1.38 2026/02/08 15:28:01 dtucker Exp $ */
/* $OpenBSD: auth2-gss.c,v 1.39 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
@@ -53,10 +53,10 @@
extern ServerOptions options;
extern struct authmethod_cfg methodcfg_gssapi;
static int input_gssapi_token(int type, u_int32_t plen, struct ssh *ssh);
static int input_gssapi_mic(int type, u_int32_t plen, struct ssh *ssh);
static int input_gssapi_exchange_complete(int type, u_int32_t plen, struct ssh *ssh);
static int input_gssapi_errtok(int, u_int32_t, struct ssh *);
static int input_gssapi_token(int type, uint32_t plen, struct ssh *ssh);
static int input_gssapi_mic(int type, uint32_t plen, struct ssh *ssh);
static int input_gssapi_exchange_complete(int type, uint32_t plen, struct ssh *ssh);
static int input_gssapi_errtok(int, uint32_t, struct ssh *);
/*
* We only support those mechanisms that we know about (ie ones that we know
@@ -143,7 +143,7 @@ userauth_gssapi(struct ssh *ssh, const char *method)
}
static int
input_gssapi_token(int type, u_int32_t plen, struct ssh *ssh)
input_gssapi_token(int type, uint32_t plen, struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
Gssctxt *gssctxt;
@@ -207,7 +207,7 @@ input_gssapi_token(int type, u_int32_t plen, struct ssh *ssh)
}
static int
input_gssapi_errtok(int type, u_int32_t plen, struct ssh *ssh)
input_gssapi_errtok(int type, uint32_t plen, struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
Gssctxt *gssctxt;
@@ -251,7 +251,7 @@ input_gssapi_errtok(int type, u_int32_t plen, struct ssh *ssh)
*/
static int
input_gssapi_exchange_complete(int type, u_int32_t plen, struct ssh *ssh)
input_gssapi_exchange_complete(int type, uint32_t plen, struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
int r, authenticated;
@@ -279,7 +279,7 @@ input_gssapi_exchange_complete(int type, u_int32_t plen, struct ssh *ssh)
}
static int
input_gssapi_mic(int type, u_int32_t plen, struct ssh *ssh)
input_gssapi_mic(int type, uint32_t plen, struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
Gssctxt *gssctxt;
+5 -5
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: auth2.c,v 1.172 2026/02/08 00:16:34 dtucker Exp $ */
/* $OpenBSD: auth2.c,v 1.173 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -88,8 +88,8 @@ Authmethod *authmethods[] = {
/* protocol */
static int input_service_request(int, u_int32_t, struct ssh *);
static int input_userauth_request(int, u_int32_t, struct ssh *);
static int input_service_request(int, uint32_t, struct ssh *);
static int input_userauth_request(int, uint32_t, struct ssh *);
/* helper */
static Authmethod *authmethod_byname(const char *);
@@ -181,7 +181,7 @@ do_authentication2(struct ssh *ssh)
}
static int
input_service_request(int type, u_int32_t seq, struct ssh *ssh)
input_service_request(int type, uint32_t seq, struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
char *service = NULL;
@@ -266,7 +266,7 @@ ensure_minimum_time_since(double start, double seconds)
}
static int
input_userauth_request(int type, u_int32_t seq, struct ssh *ssh)
input_userauth_request(int type, uint32_t seq, struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
Authmethod *m = NULL;
+2 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: authfd.c,v 1.138 2026/02/14 00:18:34 jsg Exp $ */
/* $OpenBSD: authfd.c,v 1.139 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -258,7 +258,7 @@ int
ssh_fetch_identitylist(int sock, struct ssh_identitylist **idlp)
{
u_char type;
u_int32_t num, i;
uint32_t num, i;
struct sshbuf *msg;
struct ssh_identitylist *idl = NULL;
int r;
+1 -1
View File
@@ -40,7 +40,7 @@ ipv64_normalise_mapped(struct sockaddr_storage *addr, socklen_t *len)
struct sockaddr_in6 *a6 = (struct sockaddr_in6 *)addr;
struct sockaddr_in *a4 = (struct sockaddr_in *)addr;
struct in_addr inaddr;
u_int16_t port;
uint16_t port;
if (addr->ss_family != AF_INET6 ||
!IN6_IS_ADDR_V4MAPPED(&a6->sin6_addr))
+15 -15
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: channels.c,v 1.455 2026/02/14 00:18:34 jsg Exp $ */
/* $OpenBSD: channels.c,v 1.456 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -3361,7 +3361,7 @@ channel_proxy_downstream(struct ssh *ssh, Channel *downstream)
* replaces local (proxy) channel ID with downstream channel ID.
*/
int
channel_proxy_upstream(Channel *c, int type, u_int32_t seq, struct ssh *ssh)
channel_proxy_upstream(Channel *c, int type, uint32_t seq, struct ssh *ssh)
{
struct sshbuf *b = NULL;
Channel *downstream;
@@ -3444,7 +3444,7 @@ channel_proxy_upstream(Channel *c, int type, u_int32_t seq, struct ssh *ssh)
static int
channel_parse_id(struct ssh *ssh, const char *where, const char *what)
{
u_int32_t id;
uint32_t id;
int r;
if ((r = sshpkt_get_u32(ssh, &id)) != 0) {
@@ -3473,7 +3473,7 @@ channel_from_packet_id(struct ssh *ssh, const char *where, const char *what)
}
int
channel_input_data(int type, u_int32_t seq, struct ssh *ssh)
channel_input_data(int type, uint32_t seq, struct ssh *ssh)
{
const u_char *data;
size_t data_len, win_len;
@@ -3541,11 +3541,11 @@ channel_input_data(int type, u_int32_t seq, struct ssh *ssh)
}
int
channel_input_extended_data(int type, u_int32_t seq, struct ssh *ssh)
channel_input_extended_data(int type, uint32_t seq, struct ssh *ssh)
{
const u_char *data;
size_t data_len;
u_int32_t tcode;
uint32_t tcode;
Channel *c = channel_from_packet_id(ssh, __func__, "extended data");
int r;
@@ -3594,7 +3594,7 @@ channel_input_extended_data(int type, u_int32_t seq, struct ssh *ssh)
}
int
channel_input_ieof(int type, u_int32_t seq, struct ssh *ssh)
channel_input_ieof(int type, uint32_t seq, struct ssh *ssh)
{
Channel *c = channel_from_packet_id(ssh, __func__, "ieof");
int r;
@@ -3619,7 +3619,7 @@ channel_input_ieof(int type, u_int32_t seq, struct ssh *ssh)
}
int
channel_input_oclose(int type, u_int32_t seq, struct ssh *ssh)
channel_input_oclose(int type, uint32_t seq, struct ssh *ssh)
{
Channel *c = channel_from_packet_id(ssh, __func__, "oclose");
int r;
@@ -3635,10 +3635,10 @@ channel_input_oclose(int type, u_int32_t seq, struct ssh *ssh)
}
int
channel_input_open_confirmation(int type, u_int32_t seq, struct ssh *ssh)
channel_input_open_confirmation(int type, uint32_t seq, struct ssh *ssh)
{
Channel *c = channel_from_packet_id(ssh, __func__, "open confirmation");
u_int32_t remote_window, remote_maxpacket;
uint32_t remote_window, remote_maxpacket;
int r;
if (channel_proxy_upstream(c, type, seq, ssh))
@@ -3690,10 +3690,10 @@ reason2txt(int reason)
}
int
channel_input_open_failure(int type, u_int32_t seq, struct ssh *ssh)
channel_input_open_failure(int type, uint32_t seq, struct ssh *ssh)
{
Channel *c = channel_from_packet_id(ssh, __func__, "open failure");
u_int32_t reason;
uint32_t reason;
char *msg = NULL;
int r;
@@ -3727,11 +3727,11 @@ channel_input_open_failure(int type, u_int32_t seq, struct ssh *ssh)
}
int
channel_input_window_adjust(int type, u_int32_t seq, struct ssh *ssh)
channel_input_window_adjust(int type, uint32_t seq, struct ssh *ssh)
{
int id = channel_parse_id(ssh, __func__, "window adjust");
Channel *c;
u_int32_t adjust;
uint32_t adjust;
u_int new_rwin;
int r;
@@ -3757,7 +3757,7 @@ channel_input_window_adjust(int type, u_int32_t seq, struct ssh *ssh)
}
int
channel_input_status_confirm(int type, u_int32_t seq, struct ssh *ssh)
channel_input_status_confirm(int type, uint32_t seq, struct ssh *ssh)
{
int id = channel_parse_id(ssh, __func__, "status confirm");
Channel *c;
+10 -10
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: channels.h,v 1.162 2025/10/07 08:02:32 djm Exp $ */
/* $OpenBSD: channels.h,v 1.163 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -325,18 +325,18 @@ void channel_clear_timeouts(struct ssh *);
/* mux proxy support */
int channel_proxy_downstream(struct ssh *, Channel *mc);
int channel_proxy_upstream(Channel *, int, u_int32_t, struct ssh *);
int channel_proxy_upstream(Channel *, int, uint32_t, struct ssh *);
/* protocol handler */
int channel_input_data(int, u_int32_t, struct ssh *);
int channel_input_extended_data(int, u_int32_t, struct ssh *);
int channel_input_ieof(int, u_int32_t, struct ssh *);
int channel_input_oclose(int, u_int32_t, struct ssh *);
int channel_input_open_confirmation(int, u_int32_t, struct ssh *);
int channel_input_open_failure(int, u_int32_t, struct ssh *);
int channel_input_window_adjust(int, u_int32_t, struct ssh *);
int channel_input_status_confirm(int, u_int32_t, struct ssh *);
int channel_input_data(int, uint32_t, struct ssh *);
int channel_input_extended_data(int, uint32_t, struct ssh *);
int channel_input_ieof(int, uint32_t, struct ssh *);
int channel_input_oclose(int, uint32_t, struct ssh *);
int channel_input_open_confirmation(int, uint32_t, struct ssh *);
int channel_input_open_failure(int, uint32_t, struct ssh *);
int channel_input_window_adjust(int, uint32_t, struct ssh *);
int channel_input_status_confirm(int, uint32_t, struct ssh *);
/* file descriptor handling (read/write) */
struct pollfd;
+8 -8
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: clientloop.c,v 1.420 2026/02/14 00:18:34 jsg Exp $ */
/* $OpenBSD: clientloop.c,v 1.421 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -429,7 +429,7 @@ client_x11_get_proto(struct ssh *ssh, const char *display,
* for the local connection.
*/
if (!got_data) {
u_int8_t rnd[16];
uint8_t rnd[16];
u_int i;
logit("Warning: No xauth data; "
@@ -463,7 +463,7 @@ client_check_window_change(struct ssh *ssh)
}
static int
client_global_request_reply(int type, u_int32_t seq, struct ssh *ssh)
client_global_request_reply(int type, uint32_t seq, struct ssh *ssh)
{
struct global_confirm *gc;
@@ -1455,7 +1455,7 @@ client_loop(struct ssh *ssh, int have_pty, int escape_char_arg,
u_int npfd_alloc = 0, npfd_active = 0;
double start_time, total_time;
int interactive = -1, channel_did_enqueue = 0, r;
u_int64_t ibytes, obytes;
uint64_t ibytes, obytes;
int conn_in_ready, conn_out_ready;
sigset_t bsigset, osigset;
@@ -1914,7 +1914,7 @@ client_request_tun_fwd(struct ssh *ssh, int tun_mode,
/* XXXX move to generic input handler */
static int
client_input_channel_open(int type, u_int32_t seq, struct ssh *ssh)
client_input_channel_open(int type, uint32_t seq, struct ssh *ssh)
{
Channel *c = NULL;
char *ctype = NULL;
@@ -1976,7 +1976,7 @@ client_input_channel_open(int type, u_int32_t seq, struct ssh *ssh)
}
static int
client_input_channel_req(int type, u_int32_t seq, struct ssh *ssh)
client_input_channel_req(int type, uint32_t seq, struct ssh *ssh)
{
Channel *c = NULL;
char *rtype = NULL;
@@ -2354,7 +2354,7 @@ update_known_hosts(struct hostkeys_update_ctx *ctx)
static void
client_global_hostkeys_prove_confirm(struct ssh *ssh, int type,
u_int32_t seq, void *_ctx)
uint32_t seq, void *_ctx)
{
struct hostkeys_update_ctx *ctx = (struct hostkeys_update_ctx *)_ctx;
size_t i, ndone;
@@ -2664,7 +2664,7 @@ client_input_hostkeys(struct ssh *ssh)
}
static int
client_input_global_request(int type, u_int32_t seq, struct ssh *ssh)
client_input_global_request(int type, uint32_t seq, struct ssh *ssh)
{
char *rtype;
u_char want_reply;
+2 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: clientloop.h,v 1.40 2025/12/22 01:17:31 djm Exp $ */
/* $OpenBSD: clientloop.h,v 1.41 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -55,7 +55,7 @@ void client_filter_cleanup(struct ssh *, int, void *);
int client_simple_escape_filter(struct ssh *, Channel *, char *, int);
/* Global request confirmation callbacks */
typedef void global_confirm_cb(struct ssh *, int, u_int32_t, void *);
typedef void global_confirm_cb(struct ssh *, int, uint32_t, void *);
void client_register_global_confirm(global_confirm_cb *, void *);
/* Channel request confirmation callbacks */
+3 -3
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: digest-libc.c,v 1.9 2025/12/16 08:36:43 dtucker Exp $ */
/* $OpenBSD: digest-libc.c,v 1.10 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2013 Damien Miller <djm@mindrot.org>
* Copyright (c) 2014 Markus Friedl. All rights reserved.
@@ -50,8 +50,8 @@
#include "digest.h"
typedef void md_init_fn(void *mdctx);
typedef void md_update_fn(void *mdctx, const u_int8_t *m, size_t mlen);
typedef void md_final_fn(u_int8_t[], void *mdctx);
typedef void md_update_fn(void *mdctx, const uint8_t *m, size_t mlen);
typedef void md_final_fn(uint8_t[], void *mdctx);
struct ssh_digest_ctx {
int alg;
+4 -4
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: dispatch.c,v 1.34 2025/05/21 06:44:24 djm Exp $ */
/* $OpenBSD: dispatch.c,v 1.35 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -37,7 +37,7 @@
#include "ssherr.h"
int
dispatch_protocol_error(int type, u_int32_t seq, struct ssh *ssh)
dispatch_protocol_error(int type, uint32_t seq, struct ssh *ssh)
{
int r;
@@ -51,7 +51,7 @@ dispatch_protocol_error(int type, u_int32_t seq, struct ssh *ssh)
}
int
dispatch_protocol_ignore(int type, u_int32_t seq, struct ssh *ssh)
dispatch_protocol_ignore(int type, uint32_t seq, struct ssh *ssh)
{
logit_f("type %d seq %u", type, seq);
return 0;
@@ -88,7 +88,7 @@ ssh_dispatch_run(struct ssh *ssh, int mode, volatile sig_atomic_t *done)
{
int r;
u_char type;
u_int32_t seqnr;
uint32_t seqnr;
for (;;) {
if (mode == DISPATCH_BLOCK) {
+4 -4
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: dispatch.h,v 1.15 2019/01/19 21:45:31 djm Exp $ */
/* $OpenBSD: dispatch.h,v 1.16 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
@@ -36,10 +36,10 @@ enum {
struct ssh;
typedef int dispatch_fn(int, u_int32_t, struct ssh *);
typedef int dispatch_fn(int, uint32_t, struct ssh *);
int dispatch_protocol_error(int, u_int32_t, struct ssh *);
int dispatch_protocol_ignore(int, u_int32_t, struct ssh *);
int dispatch_protocol_error(int, uint32_t, struct ssh *);
int dispatch_protocol_ignore(int, uint32_t, struct ssh *);
void ssh_dispatch_init(struct ssh *, dispatch_fn *);
void ssh_dispatch_set(struct ssh *, int, dispatch_fn *);
void ssh_dispatch_range(struct ssh *, u_int, u_int, dispatch_fn *);
+9 -9
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: dns.c,v 1.47 2026/02/14 00:18:34 jsg Exp $ */
/* $OpenBSD: dns.c,v 1.48 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2003 Wesley Griffin. All rights reserved.
@@ -77,7 +77,7 @@ dns_result_totext(unsigned int res)
* Caller must free digest which is allocated by sshkey_fingerprint_raw().
*/
static int
dns_read_key(u_int8_t *algorithm, u_int8_t *digest_type,
dns_read_key(uint8_t *algorithm, uint8_t *digest_type,
u_char **digest, size_t *digest_len, struct sshkey *key)
{
int r, success = 0;
@@ -125,7 +125,7 @@ dns_read_key(u_int8_t *algorithm, u_int8_t *digest_type,
* Read SSHFP parameters from rdata buffer.
*/
static int
dns_read_rdata(u_int8_t *algorithm, u_int8_t *digest_type,
dns_read_rdata(uint8_t *algorithm, uint8_t *digest_type,
u_char **digest, size_t *digest_len, u_char *rdata, int rdata_len)
{
int success = 0;
@@ -193,12 +193,12 @@ verify_host_key_dns(const char *hostname, struct sockaddr *address,
int result;
struct rrsetinfo *fingerprints = NULL;
u_int8_t hostkey_algorithm;
uint8_t hostkey_algorithm;
u_char *hostkey_digest;
size_t hostkey_digest_len;
u_int8_t dnskey_algorithm;
u_int8_t dnskey_digest_type;
uint8_t dnskey_algorithm;
uint8_t dnskey_digest_type;
u_char *dnskey_digest;
size_t dnskey_digest_len;
@@ -298,9 +298,9 @@ int
export_dns_rr(const char *hostname, struct sshkey *key, FILE *f, int generic,
int alg)
{
u_int8_t rdata_pubkey_algorithm = 0;
u_int8_t rdata_digest_type = SSHFP_HASH_RESERVED;
u_int8_t dtype;
uint8_t rdata_pubkey_algorithm = 0;
uint8_t rdata_digest_type = SSHFP_HASH_RESERVED;
uint8_t dtype;
u_char *rdata_digest;
size_t i, rdata_digest_len;
int success = 0;
+1 -1
View File
@@ -112,7 +112,7 @@ seed_rng(void)
void
reseed_prngs(void)
{
u_int32_t rnd[256];
uint32_t rnd[256];
#ifdef WITH_OPENSSL
RAND_poll();
+7 -7
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: kex.c,v 1.191 2026/02/14 00:18:34 jsg Exp $ */
/* $OpenBSD: kex.c,v 1.192 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
*
@@ -62,7 +62,7 @@
/* prototype */
static int kex_choose_conf(struct ssh *, uint32_t seq);
static int kex_input_newkeys(int, u_int32_t, struct ssh *);
static int kex_input_newkeys(int, uint32_t, struct ssh *);
static const char * const proposal_names[PROPOSAL_MAX] = {
"KEX algorithms",
@@ -229,7 +229,7 @@ kex_prop_free(char **proposal)
}
int
kex_protocol_error(int type, u_int32_t seq, struct ssh *ssh)
kex_protocol_error(int type, uint32_t seq, struct ssh *ssh)
{
int r;
@@ -470,11 +470,11 @@ kex_ext_info_server_parse(struct ssh *ssh, const char *name,
}
int
kex_input_ext_info(int type, u_int32_t seq, struct ssh *ssh)
kex_input_ext_info(int type, uint32_t seq, struct ssh *ssh)
{
struct kex *kex = ssh->kex;
const int max_ext_info = kex->server ? 1 : 2;
u_int32_t i, ninfo;
uint32_t i, ninfo;
char *name;
u_char *val;
size_t vlen;
@@ -517,7 +517,7 @@ kex_input_ext_info(int type, u_int32_t seq, struct ssh *ssh)
}
static int
kex_input_newkeys(int type, u_int32_t seq, struct ssh *ssh)
kex_input_newkeys(int type, uint32_t seq, struct ssh *ssh)
{
struct kex *kex = ssh->kex;
int r, initial = (kex->flags & KEX_INITIAL) != 0;
@@ -601,7 +601,7 @@ kex_send_kexinit(struct ssh *ssh)
}
int
kex_input_kexinit(int type, u_int32_t seq, struct ssh *ssh)
kex_input_kexinit(int type, uint32_t seq, struct ssh *ssh)
{
struct kex *kex = ssh->kex;
const u_char *ptr;
+4 -4
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: kex.h,v 1.127 2025/08/11 10:55:38 djm Exp $ */
/* $OpenBSD: kex.h,v 1.128 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
@@ -218,9 +218,9 @@ int kex_load_hostkey(struct ssh *, struct sshkey **, struct sshkey **);
int kex_verify_host_key(struct ssh *, struct sshkey *);
int kex_send_kexinit(struct ssh *);
int kex_input_kexinit(int, u_int32_t, struct ssh *);
int kex_input_ext_info(int, u_int32_t, struct ssh *);
int kex_protocol_error(int, u_int32_t, struct ssh *);
int kex_input_kexinit(int, uint32_t, struct ssh *);
int kex_input_ext_info(int, uint32_t, struct ssh *);
int kex_protocol_error(int, uint32_t, struct ssh *);
int kex_derive_keys(struct ssh *, u_char *, u_int, const struct sshbuf *);
int kex_send_newkeys(struct ssh *);
int kex_start_rekex(struct ssh *);
+5 -5
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: kexgen.c,v 1.11 2026/02/08 19:54:31 dtucker Exp $ */
/* $OpenBSD: kexgen.c,v 1.12 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2019 Markus Friedl. All rights reserved.
*
@@ -41,8 +41,8 @@
#include "digest.h"
#include "ssherr.h"
static int input_kex_gen_init(int, u_int32_t, struct ssh *);
static int input_kex_gen_reply(int type, u_int32_t seq, struct ssh *ssh);
static int input_kex_gen_init(int, uint32_t, struct ssh *);
static int input_kex_gen_reply(int type, uint32_t seq, struct ssh *ssh);
static int
kex_gen_hash(
@@ -139,7 +139,7 @@ kex_gen_client(struct ssh *ssh)
}
static int
input_kex_gen_reply(int type, u_int32_t seq, struct ssh *ssh)
input_kex_gen_reply(int type, uint32_t seq, struct ssh *ssh)
{
struct kex *kex = ssh->kex;
struct sshkey *server_host_key = NULL;
@@ -272,7 +272,7 @@ kex_gen_server(struct ssh *ssh)
}
static int
input_kex_gen_init(int type, u_int32_t seq, struct ssh *ssh)
input_kex_gen_init(int type, uint32_t seq, struct ssh *ssh)
{
struct kex *kex = ssh->kex;
struct sshkey *server_host_private, *server_host_public;
+5 -5
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: kexgexc.c,v 1.41 2026/02/14 00:18:34 jsg Exp $ */
/* $OpenBSD: kexgexc.c,v 1.42 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2000 Niels Provos. All rights reserved.
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -52,8 +52,8 @@
#include "sshbuf.h"
#include "misc.h"
static int input_kex_dh_gex_group(int, u_int32_t, struct ssh *);
static int input_kex_dh_gex_reply(int, u_int32_t, struct ssh *);
static int input_kex_dh_gex_group(int, uint32_t, struct ssh *);
static int input_kex_dh_gex_reply(int, uint32_t, struct ssh *);
int
kexgex_client(struct ssh *ssh)
@@ -91,7 +91,7 @@ kexgex_client(struct ssh *ssh)
}
static int
input_kex_dh_gex_group(int type, u_int32_t seq, struct ssh *ssh)
input_kex_dh_gex_group(int type, uint32_t seq, struct ssh *ssh)
{
struct kex *kex = ssh->kex;
BIGNUM *p = NULL, *g = NULL;
@@ -141,7 +141,7 @@ out:
}
static int
input_kex_dh_gex_reply(int type, u_int32_t seq, struct ssh *ssh)
input_kex_dh_gex_reply(int type, uint32_t seq, struct ssh *ssh)
{
struct kex *kex = ssh->kex;
BIGNUM *dh_server_pub = NULL;
+5 -5
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: kexgexs.c,v 1.50 2026/02/08 19:54:31 dtucker Exp $ */
/* $OpenBSD: kexgexs.c,v 1.51 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2000 Niels Provos. All rights reserved.
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -54,8 +54,8 @@
#include "sshbuf.h"
#include "misc.h"
static int input_kex_dh_gex_request(int, u_int32_t, struct ssh *);
static int input_kex_dh_gex_init(int, u_int32_t, struct ssh *);
static int input_kex_dh_gex_request(int, uint32_t, struct ssh *);
static int input_kex_dh_gex_init(int, uint32_t, struct ssh *);
int
kexgex_server(struct ssh *ssh)
@@ -67,7 +67,7 @@ kexgex_server(struct ssh *ssh)
}
static int
input_kex_dh_gex_request(int type, u_int32_t seq, struct ssh *ssh)
input_kex_dh_gex_request(int type, uint32_t seq, struct ssh *ssh)
{
struct kex *kex = ssh->kex;
int r;
@@ -123,7 +123,7 @@ input_kex_dh_gex_request(int type, u_int32_t seq, struct ssh *ssh)
}
static int
input_kex_dh_gex_init(int type, u_int32_t seq, struct ssh *ssh)
input_kex_dh_gex_init(int type, uint32_t seq, struct ssh *ssh)
{
struct kex *kex = ssh->kex;
BIGNUM *dh_client_pub = NULL;
+17 -17
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: krl.c,v 1.63 2026/02/14 00:18:34 jsg Exp $ */
/* $OpenBSD: krl.c,v 1.64 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2012 Damien Miller <djm@mindrot.org>
*
@@ -52,7 +52,7 @@
/* Tree of serial numbers. XXX make smarter: really need a real sparse bitmap */
struct revoked_serial {
u_int64_t lo, hi;
uint64_t lo, hi;
RB_ENTRY(revoked_serial) tree_entry;
};
static int serial_cmp(struct revoked_serial *a, struct revoked_serial *b);
@@ -88,9 +88,9 @@ struct revoked_certs {
TAILQ_HEAD(revoked_certs_list, revoked_certs);
struct ssh_krl {
u_int64_t krl_version;
u_int64_t generated_date;
u_int64_t flags;
uint64_t krl_version;
uint64_t generated_date;
uint64_t flags;
char *comment;
struct revoked_blob_tree revoked_keys;
struct revoked_blob_tree revoked_sha1s;
@@ -194,7 +194,7 @@ ssh_krl_free(struct ssh_krl *krl)
}
void
ssh_krl_set_version(struct ssh_krl *krl, u_int64_t version)
ssh_krl_set_version(struct ssh_krl *krl, uint64_t version)
{
krl->krl_version = version;
}
@@ -247,7 +247,7 @@ revoked_certs_for_ca_key(struct ssh_krl *krl, const struct sshkey *ca_key,
}
static int
insert_serial_range(struct revoked_serial_tree *rt, u_int64_t lo, u_int64_t hi)
insert_serial_range(struct revoked_serial_tree *rt, uint64_t lo, uint64_t hi)
{
struct revoked_serial rs, *ers, *crs, *irs;
@@ -302,7 +302,7 @@ insert_serial_range(struct revoked_serial_tree *rt, u_int64_t lo, u_int64_t hi)
/* Check successors */
while ((crs = RB_NEXT(revoked_serial_tree, rt, ers)) != NULL) {
KRL_DBG(("succ %llu:%llu", crs->lo, crs->hi));
if (ers->hi != (u_int64_t)-1 && crs->lo > ers->hi + 1)
if (ers->hi != (uint64_t)-1 && crs->lo > ers->hi + 1)
break;
/* This entry overlaps. */
if (crs->hi > ers->hi) {
@@ -318,14 +318,14 @@ insert_serial_range(struct revoked_serial_tree *rt, u_int64_t lo, u_int64_t hi)
int
ssh_krl_revoke_cert_by_serial(struct ssh_krl *krl, const struct sshkey *ca_key,
u_int64_t serial)
uint64_t serial)
{
return ssh_krl_revoke_cert_by_serial_range(krl, ca_key, serial, serial);
}
int
ssh_krl_revoke_cert_by_serial_range(struct ssh_krl *krl,
const struct sshkey *ca_key, u_int64_t lo, u_int64_t hi)
const struct sshkey *ca_key, uint64_t lo, uint64_t hi)
{
struct revoked_certs *rc;
int r;
@@ -474,11 +474,11 @@ ssh_krl_revoke_key(struct ssh_krl *krl, const struct sshkey *key)
* that will minimise the size of the resultant KRL.
*/
static int
choose_next_state(int current_state, u_int64_t contig, int final,
u_int64_t last_gap, u_int64_t next_gap, int *force_new_section)
choose_next_state(int current_state, uint64_t contig, int final,
uint64_t last_gap, uint64_t next_gap, int *force_new_section)
{
int new_state;
u_int64_t cost, cost_list, cost_range, cost_bitmap, cost_bitmap_restart;
uint64_t cost, cost_list, cost_range, cost_bitmap, cost_bitmap_restart;
/*
* Avoid unsigned overflows.
@@ -573,7 +573,7 @@ static int
revoked_certs_generate(struct revoked_certs *rc, struct sshbuf *buf)
{
int final, force_new_sect, r = SSH_ERR_INTERNAL_ERROR;
u_int64_t i, contig, gap, last = 0, bitmap_start = 0;
uint64_t i, contig, gap, last = 0, bitmap_start = 0;
struct revoked_serial *rs, *nrs;
struct revoked_key_id *rki;
int next_state, state = 0;
@@ -808,7 +808,7 @@ ssh_krl_to_blob(struct ssh_krl *krl, struct sshbuf *buf)
}
static void
format_timestamp(u_int64_t timestamp, char *ts, size_t nts)
format_timestamp(uint64_t timestamp, char *ts, size_t nts)
{
time_t t;
struct tm *tm;
@@ -870,7 +870,7 @@ parse_revoked_certs(struct sshbuf *buf, struct ssh_krl *krl)
const u_char *blob;
size_t blen, nbits;
struct sshbuf *subsect = NULL;
u_int64_t serial, serial_lo, serial_hi;
uint64_t serial, serial_lo, serial_hi;
struct bitmap *bitmap = NULL;
char *key_id = NULL;
struct sshkey *ca_key = NULL;
@@ -926,7 +926,7 @@ parse_revoked_certs(struct sshbuf *buf, struct ssh_krl *krl)
goto out;
}
nbits = bitmap_nbits(bitmap);
for (serial = 0; serial < (u_int64_t)nbits; serial++) {
for (serial = 0; serial < (uint64_t)nbits; serial++) {
if (serial > 0 && serial_lo + serial == 0) {
error_f("bitmap wraps u64");
r = SSH_ERR_INVALID_FORMAT;
+4 -4
View File
@@ -14,7 +14,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $OpenBSD: krl.h,v 1.10 2023/07/17 04:01:10 djm Exp $ */
/* $OpenBSD: krl.h,v 1.11 2026/03/03 09:57:25 dtucker Exp $ */
#ifndef _KRL_H
#define _KRL_H
@@ -45,12 +45,12 @@ struct ssh_krl;
struct ssh_krl *ssh_krl_init(void);
void ssh_krl_free(struct ssh_krl *krl);
void ssh_krl_set_version(struct ssh_krl *krl, u_int64_t version);
void ssh_krl_set_version(struct ssh_krl *krl, uint64_t version);
int ssh_krl_set_comment(struct ssh_krl *krl, const char *comment);
int ssh_krl_revoke_cert_by_serial(struct ssh_krl *krl,
const struct sshkey *ca_key, u_int64_t serial);
const struct sshkey *ca_key, uint64_t serial);
int ssh_krl_revoke_cert_by_serial_range(struct ssh_krl *krl,
const struct sshkey *ca_key, u_int64_t lo, u_int64_t hi);
const struct sshkey *ca_key, uint64_t lo, uint64_t hi);
int ssh_krl_revoke_cert_by_key_id(struct ssh_krl *krl,
const struct sshkey *ca_key, const char *key_id);
int ssh_krl_revoke_key_explicit(struct ssh_krl *krl, const struct sshkey *key);
+4 -4
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: mac.c,v 1.37 2025/09/05 10:01:35 dtucker Exp $ */
/* $OpenBSD: mac.c,v 1.38 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
@@ -152,13 +152,13 @@ mac_init(struct sshmac *mac)
}
int
mac_compute(struct sshmac *mac, u_int32_t seqno,
mac_compute(struct sshmac *mac, uint32_t seqno,
const u_char *data, int datalen,
u_char *digest, size_t dlen)
{
static union {
u_char m[SSH_DIGEST_MAX_LENGTH];
u_int64_t for_align;
uint64_t for_align;
} u;
u_char b[4];
u_char nonce[8];
@@ -198,7 +198,7 @@ mac_compute(struct sshmac *mac, u_int32_t seqno,
}
int
mac_check(struct sshmac *mac, u_int32_t seqno,
mac_check(struct sshmac *mac, uint32_t seqno,
const u_char *data, size_t dlen,
const u_char *theirmac, size_t mlen)
{
+3 -3
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: mac.h,v 1.10 2016/07/08 03:44:42 djm Exp $ */
/* $OpenBSD: mac.h,v 1.11 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
@@ -44,9 +44,9 @@ int mac_valid(const char *);
char *mac_alg_list(char);
int mac_setup(struct sshmac *, char *);
int mac_init(struct sshmac *);
int mac_compute(struct sshmac *, u_int32_t, const u_char *, int,
int mac_compute(struct sshmac *, uint32_t, const u_char *, int,
u_char *, size_t);
int mac_check(struct sshmac *, u_int32_t, const u_char *, size_t,
int mac_check(struct sshmac *, uint32_t, const u_char *, size_t,
const u_char *, size_t);
void mac_clear(struct sshmac *);
+33 -33
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: misc.c,v 1.212 2026/02/11 17:05:32 dtucker Exp $ */
/* $OpenBSD: misc.c,v 1.213 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2005-2020 Damien Miller. All rights reserved.
@@ -1660,66 +1660,66 @@ xextendf(char **sp, const char *sep, const char *fmt, ...)
}
u_int64_t
uint64_t
get_u64(const void *vp)
{
const u_char *p = (const u_char *)vp;
u_int64_t v;
uint64_t v;
v = (u_int64_t)p[0] << 56;
v |= (u_int64_t)p[1] << 48;
v |= (u_int64_t)p[2] << 40;
v |= (u_int64_t)p[3] << 32;
v |= (u_int64_t)p[4] << 24;
v |= (u_int64_t)p[5] << 16;
v |= (u_int64_t)p[6] << 8;
v |= (u_int64_t)p[7];
v = (uint64_t)p[0] << 56;
v |= (uint64_t)p[1] << 48;
v |= (uint64_t)p[2] << 40;
v |= (uint64_t)p[3] << 32;
v |= (uint64_t)p[4] << 24;
v |= (uint64_t)p[5] << 16;
v |= (uint64_t)p[6] << 8;
v |= (uint64_t)p[7];
return (v);
}
u_int32_t
uint32_t
get_u32(const void *vp)
{
const u_char *p = (const u_char *)vp;
u_int32_t v;
uint32_t v;
v = (u_int32_t)p[0] << 24;
v |= (u_int32_t)p[1] << 16;
v |= (u_int32_t)p[2] << 8;
v |= (u_int32_t)p[3];
v = (uint32_t)p[0] << 24;
v |= (uint32_t)p[1] << 16;
v |= (uint32_t)p[2] << 8;
v |= (uint32_t)p[3];
return (v);
}
u_int32_t
uint32_t
get_u32_le(const void *vp)
{
const u_char *p = (const u_char *)vp;
u_int32_t v;
uint32_t v;
v = (u_int32_t)p[0];
v |= (u_int32_t)p[1] << 8;
v |= (u_int32_t)p[2] << 16;
v |= (u_int32_t)p[3] << 24;
v = (uint32_t)p[0];
v |= (uint32_t)p[1] << 8;
v |= (uint32_t)p[2] << 16;
v |= (uint32_t)p[3] << 24;
return (v);
}
u_int16_t
uint16_t
get_u16(const void *vp)
{
const u_char *p = (const u_char *)vp;
u_int16_t v;
uint16_t v;
v = (u_int16_t)p[0] << 8;
v |= (u_int16_t)p[1];
v = (uint16_t)p[0] << 8;
v |= (uint16_t)p[1];
return (v);
}
void
put_u64(void *vp, u_int64_t v)
put_u64(void *vp, uint64_t v)
{
u_char *p = (u_char *)vp;
@@ -1734,7 +1734,7 @@ put_u64(void *vp, u_int64_t v)
}
void
put_u32(void *vp, u_int32_t v)
put_u32(void *vp, uint32_t v)
{
u_char *p = (u_char *)vp;
@@ -1745,7 +1745,7 @@ put_u32(void *vp, u_int32_t v)
}
void
put_u32_le(void *vp, u_int32_t v)
put_u32_le(void *vp, uint32_t v)
{
u_char *p = (u_char *)vp;
@@ -1756,7 +1756,7 @@ put_u32_le(void *vp, u_int32_t v)
}
void
put_u16(void *vp, u_int16_t v)
put_u16(void *vp, uint16_t v)
{
u_char *p = (u_char *)vp;
@@ -1843,7 +1843,7 @@ monotime_double(void)
}
void
bandwidth_limit_init(struct bwlimit *bw, u_int64_t kbps, size_t buflen)
bandwidth_limit_init(struct bwlimit *bw, uint64_t kbps, size_t buflen)
{
bw->buflen = buflen;
bw->rate = kbps;
@@ -1857,7 +1857,7 @@ bandwidth_limit_init(struct bwlimit *bw, u_int64_t kbps, size_t buflen)
void
bandwidth_limit(struct bwlimit *bw, size_t read_len)
{
u_int64_t waitlen;
uint64_t waitlen;
struct timespec ts, rm;
bw->lamt += read_len;
+13 -13
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: misc.h,v 1.114 2025/12/05 07:43:12 djm Exp $ */
/* $OpenBSD: misc.h,v 1.115 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -160,34 +160,34 @@ int tun_open(int, int, char **);
#define PORT_STREAMLOCAL -2
/* Functions to extract or store big-endian words of various sizes */
u_int64_t get_u64(const void *)
uint64_t get_u64(const void *)
__attribute__((__bounded__( __minbytes__, 1, 8)));
u_int32_t get_u32(const void *)
uint32_t get_u32(const void *)
__attribute__((__bounded__( __minbytes__, 1, 4)));
u_int16_t get_u16(const void *)
uint16_t get_u16(const void *)
__attribute__((__bounded__( __minbytes__, 1, 2)));
void put_u64(void *, u_int64_t)
void put_u64(void *, uint64_t)
__attribute__((__bounded__( __minbytes__, 1, 8)));
void put_u32(void *, u_int32_t)
void put_u32(void *, uint32_t)
__attribute__((__bounded__( __minbytes__, 1, 4)));
void put_u16(void *, u_int16_t)
void put_u16(void *, uint16_t)
__attribute__((__bounded__( __minbytes__, 1, 2)));
/* Little-endian store/load, used by umac.c */
u_int32_t get_u32_le(const void *)
uint32_t get_u32_le(const void *)
__attribute__((__bounded__(__minbytes__, 1, 4)));
void put_u32_le(void *, u_int32_t)
void put_u32_le(void *, uint32_t)
__attribute__((__bounded__(__minbytes__, 1, 4)));
struct bwlimit {
size_t buflen;
u_int64_t rate; /* desired rate in kbit/s */
u_int64_t thresh; /* threshold after which we'll check timers */
u_int64_t lamt; /* amount written in last timer interval */
uint64_t rate; /* desired rate in kbit/s */
uint64_t thresh; /* threshold after which we'll check timers */
uint64_t lamt; /* amount written in last timer interval */
struct timeval bwstart, bwend;
};
void bandwidth_limit_init(struct bwlimit *, u_int64_t, size_t);
void bandwidth_limit_init(struct bwlimit *, uint64_t, size_t);
void bandwidth_limit(struct bwlimit *, size_t);
int parse_ipqos(const char *);
+25 -25
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: moduli.c,v 1.40 2025/05/24 03:39:48 dtucker Exp $ */
/* $OpenBSD: moduli.c,v 1.41 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright 1994 Phil Karn <karn@qualcomm.com>
* Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com>
@@ -125,26 +125,26 @@
*/
/* sieve 2**16 */
static u_int32_t *TinySieve, tinybits;
static uint32_t *TinySieve, tinybits;
/* sieve 2**30 in 2**16 parts */
static u_int32_t *SmallSieve, smallbits, smallbase;
static uint32_t *SmallSieve, smallbits, smallbase;
/* sieve relative to the initial value */
static u_int32_t *LargeSieve, largewords, largetries, largenumbers;
static u_int32_t largebits, largememory; /* megabytes */
static uint32_t *LargeSieve, largewords, largetries, largenumbers;
static uint32_t largebits, largememory; /* megabytes */
static BIGNUM *largebase;
int gen_candidates(FILE *, u_int32_t, BIGNUM *);
int prime_test(FILE *, FILE *, u_int32_t, u_int32_t, char *, unsigned long,
int gen_candidates(FILE *, uint32_t, BIGNUM *);
int prime_test(FILE *, FILE *, uint32_t, uint32_t, char *, unsigned long,
unsigned long);
/*
* print moduli out in consistent form,
*/
static int
qfileout(FILE * ofile, u_int32_t otype, u_int32_t otests, u_int32_t otries,
u_int32_t osize, u_int32_t ogenerator, BIGNUM * omodulus)
qfileout(FILE * ofile, uint32_t otype, uint32_t otests, uint32_t otries,
uint32_t osize, uint32_t ogenerator, BIGNUM * omodulus)
{
struct tm *gtm;
time_t time_now;
@@ -177,9 +177,9 @@ qfileout(FILE * ofile, u_int32_t otype, u_int32_t otests, u_int32_t otries,
** Sieve p's and q's with small factors
*/
static void
sieve_large(u_int32_t s32)
sieve_large(uint32_t s32)
{
u_int64_t r, u, s = s32;
uint64_t r, u, s = s32;
debug3("sieve_large %u", s32);
largetries++;
@@ -235,14 +235,14 @@ sieve_large(u_int32_t s32)
* The list is checked against small known primes (less than 2**30).
*/
int
gen_candidates(FILE *out, u_int32_t power, BIGNUM *start)
gen_candidates(FILE *out, uint32_t power, BIGNUM *start)
{
BIGNUM *q;
u_int32_t j, r, s, t;
u_int32_t smallwords = TINY_NUMBER >> 6;
u_int32_t tinywords = TINY_NUMBER >> 6;
uint32_t j, r, s, t;
uint32_t smallwords = TINY_NUMBER >> 6;
uint32_t tinywords = TINY_NUMBER >> 6;
time_t time_start, time_stop;
u_int32_t i;
uint32_t i;
int ret = 0;
/*
@@ -262,13 +262,13 @@ gen_candidates(FILE *out, u_int32_t power, BIGNUM *start)
largememory = LARGE_MAXIMUM;
largewords = (largememory << SHIFT_MEGAWORD);
TinySieve = xcalloc(tinywords, sizeof(u_int32_t));
TinySieve = xcalloc(tinywords, sizeof(uint32_t));
tinybits = tinywords << SHIFT_WORD;
SmallSieve = xcalloc(smallwords, sizeof(u_int32_t));
SmallSieve = xcalloc(smallwords, sizeof(uint32_t));
smallbits = smallwords << SHIFT_WORD;
LargeSieve = xcalloc(largewords, sizeof(u_int32_t));
LargeSieve = xcalloc(largewords, sizeof(uint32_t));
largebits = largewords << SHIFT_WORD;
largenumbers = largebits * 2; /* even numbers excluded */
@@ -403,7 +403,7 @@ gen_candidates(FILE *out, u_int32_t power, BIGNUM *start)
}
static void
write_checkpoint(char *cpfile, u_int32_t lineno)
write_checkpoint(char *cpfile, uint32_t lineno)
{
FILE *fp;
char tmp[PATH_MAX];
@@ -532,13 +532,13 @@ print_progress(unsigned long start_lineno, unsigned long current_lineno,
* The result is a list of so-call "safe" primes
*/
int
prime_test(FILE *in, FILE *out, u_int32_t trials, u_int32_t generator_wanted,
prime_test(FILE *in, FILE *out, uint32_t trials, uint32_t generator_wanted,
char *checkpoint_file, unsigned long start_lineno, unsigned long num_lines)
{
BIGNUM *q, *p, *a;
char *cp, *lp;
u_int32_t count_in = 0, count_out = 0, count_possible = 0;
u_int32_t generator_known, in_tests, in_tries, in_type, in_size;
uint32_t count_in = 0, count_out = 0, count_possible = 0;
uint32_t generator_known, in_tests, in_tries, in_type, in_size;
unsigned long last_processed = 0, end_lineno;
time_t time_start, time_stop;
int res, is_prime;
@@ -653,7 +653,7 @@ prime_test(FILE *in, FILE *out, u_int32_t trials, u_int32_t generator_wanted,
* due to earlier inconsistencies in interpretation, check
* the proposed bit size.
*/
if ((u_int32_t)BN_num_bits(p) != (in_size + 1)) {
if ((uint32_t)BN_num_bits(p) != (in_size + 1)) {
debug2("%10u: bit size %u mismatch", count_in, in_size);
continue;
}
@@ -674,7 +674,7 @@ prime_test(FILE *in, FILE *out, u_int32_t trials, u_int32_t generator_wanted,
if (BN_mod_word(p, 24) == 11)
generator_known = 2;
else {
u_int32_t r = BN_mod_word(p, 10);
uint32_t r = BN_mod_word(p, 10);
if (r == 3 || r == 7)
generator_known = 5;
+2 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: mux.c,v 1.110 2026/02/14 00:18:34 jsg Exp $ */
/* $OpenBSD: mux.c,v 1.111 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org>
*
@@ -626,7 +626,7 @@ compare_forward(struct Forward *a, struct Forward *b)
}
static void
mux_confirm_remote_forward(struct ssh *ssh, int type, u_int32_t seq, void *ctxt)
mux_confirm_remote_forward(struct ssh *ssh, int type, uint32_t seq, void *ctxt)
{
struct mux_channel_confirm_ctx *fctx = ctxt;
char *failmsg = NULL;
+26 -26
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: packet.c,v 1.333 2026/02/14 00:18:34 jsg Exp $ */
/* $OpenBSD: packet.c,v 1.334 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -99,10 +99,10 @@
#define PACKET_MAX_SIZE (256 * 1024)
struct packet_state {
u_int32_t seqnr;
u_int32_t packets;
u_int64_t blocks;
u_int64_t bytes;
uint32_t seqnr;
uint32_t packets;
uint64_t blocks;
uint64_t bytes;
};
struct packet {
@@ -180,11 +180,11 @@ struct session_state {
struct packet_state p_read, p_send;
/* Volume-based rekeying */
u_int64_t hard_max_blocks_in, hard_max_blocks_out;
u_int64_t max_blocks_in, max_blocks_out, rekey_limit;
uint64_t hard_max_blocks_in, hard_max_blocks_out;
uint64_t max_blocks_in, max_blocks_out, rekey_limit;
/* Time-based rekeying */
u_int32_t rekey_interval; /* how often in seconds */
uint32_t rekey_interval; /* how often in seconds */
time_t rekey_time; /* time of last rekeying */
/* roundup current message to extra_pad bytes */
@@ -469,7 +469,7 @@ ssh_packet_connection_is_on_socket(struct ssh *ssh)
}
void
ssh_packet_get_bytes(struct ssh *ssh, u_int64_t *ibytes, u_int64_t *obytes)
ssh_packet_get_bytes(struct ssh *ssh, uint64_t *ibytes, uint64_t *obytes)
{
if (ibytes)
*ibytes = ssh->state->p_read.bytes;
@@ -976,7 +976,7 @@ ssh_set_newkeys(struct ssh *ssh, int mode)
struct sshcomp *comp;
struct sshcipher_ctx **ccp;
struct packet_state *ps;
u_int64_t *max_blocks, *hard_max_blocks;
uint64_t *max_blocks, *hard_max_blocks;
const char *wmsg;
int r, crypt_type;
const char *dir = mode == MODE_OUT ? "out" : "in";
@@ -1054,9 +1054,9 @@ ssh_set_newkeys(struct ssh *ssh, int mode)
* See RFC4344 section 3.2.
*/
if (enc->block_size >= 16)
*hard_max_blocks = (u_int64_t)1 << (enc->block_size*2);
*hard_max_blocks = (uint64_t)1 << (enc->block_size*2);
else
*hard_max_blocks = ((u_int64_t)1 << 30) / enc->block_size;
*hard_max_blocks = ((uint64_t)1 << 30) / enc->block_size;
*max_blocks = *hard_max_blocks;
if (state->rekey_limit) {
*max_blocks = MINIMUM(*max_blocks,
@@ -1078,10 +1078,10 @@ static inline int
ssh_packet_check_rekey_blocklimit(struct ssh *ssh, u_int packet_len, int hard)
{
struct session_state *state = ssh->state;
u_int32_t out_blocks;
const u_int64_t max_blocks_in = hard ?
uint32_t out_blocks;
const uint64_t max_blocks_in = hard ?
state->hard_max_blocks_in : state->max_blocks_in;
const u_int64_t max_blocks_out = hard ?
const uint64_t max_blocks_out = hard ?
state->hard_max_blocks_out : state->max_blocks_out;
/*
@@ -1485,7 +1485,7 @@ ssh_packet_send2(struct ssh *ssh)
*/
int
ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, uint32_t *seqnr_p)
{
struct session_state *state = ssh->state;
int len, r, ms_remain = 0;
@@ -1578,7 +1578,7 @@ ssh_packet_read(struct ssh *ssh)
}
static int
ssh_packet_read_poll2_mux(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
ssh_packet_read_poll2_mux(struct ssh *ssh, u_char *typep, uint32_t *seqnr_p)
{
struct session_state *state = ssh->state;
const u_char *cp;
@@ -1616,7 +1616,7 @@ ssh_packet_read_poll2_mux(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
}
int
ssh_packet_read_poll2(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
ssh_packet_read_poll2(struct ssh *ssh, u_char *typep, uint32_t *seqnr_p)
{
struct session_state *state = ssh->state;
u_int padlen, need;
@@ -1853,7 +1853,7 @@ ssh_packet_read_poll2(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
}
int
ssh_packet_read_poll_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
ssh_packet_read_poll_seqnr(struct ssh *ssh, u_char *typep, uint32_t *seqnr_p)
{
struct session_state *state = ssh->state;
u_int reason, seqnr;
@@ -2342,7 +2342,7 @@ ssh_packet_get_maxsize(struct ssh *ssh)
}
void
ssh_packet_set_rekey_limits(struct ssh *ssh, u_int64_t bytes, u_int32_t seconds)
ssh_packet_set_rekey_limits(struct ssh *ssh, uint64_t bytes, uint32_t seconds)
{
debug3("rekey after %llu bytes, %u seconds", (unsigned long long)bytes,
(unsigned int)seconds);
@@ -2690,13 +2690,13 @@ sshpkt_put_u8(struct ssh *ssh, u_char val)
}
int
sshpkt_put_u32(struct ssh *ssh, u_int32_t val)
sshpkt_put_u32(struct ssh *ssh, uint32_t val)
{
return sshbuf_put_u32(ssh->state->outgoing_packet, val);
}
int
sshpkt_put_u64(struct ssh *ssh, u_int64_t val)
sshpkt_put_u64(struct ssh *ssh, uint64_t val)
{
return sshbuf_put_u64(ssh->state->outgoing_packet, val);
}
@@ -2756,13 +2756,13 @@ sshpkt_get_u8(struct ssh *ssh, u_char *valp)
}
int
sshpkt_get_u32(struct ssh *ssh, u_int32_t *valp)
sshpkt_get_u32(struct ssh *ssh, uint32_t *valp)
{
return sshbuf_get_u32(ssh->state->incoming_packet, valp);
}
int
sshpkt_get_u64(struct ssh *ssh, u_int64_t *valp)
sshpkt_get_u64(struct ssh *ssh, uint64_t *valp)
{
return sshbuf_get_u64(ssh->state->incoming_packet, valp);
}
@@ -2887,7 +2887,7 @@ ssh_packet_send_mux(struct ssh *ssh)
int
sshpkt_msg_ignore(struct ssh *ssh, u_int nbytes)
{
u_int32_t rnd = 0;
uint32_t rnd = 0;
int r;
u_int i;
@@ -3022,7 +3022,7 @@ connection_info_message(struct ssh *ssh)
struct session_state *state;
struct newkeys *nk_in, *nk_out;
char *stats_in = NULL, *stats_out = NULL;
u_int64_t epoch = (u_int64_t)time(NULL) - monotime();
uint64_t epoch = (uint64_t)time(NULL) - monotime();
if (ssh == NULL)
return NULL;
+10 -10
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: packet.h,v 1.106 2026/03/02 02:40:15 djm Exp $ */
/* $OpenBSD: packet.h,v 1.107 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -127,11 +127,11 @@ int ssh_packet_send2_wrapped(struct ssh *);
int ssh_packet_send2(struct ssh *);
int ssh_packet_read(struct ssh *);
int ssh_packet_read_poll2(struct ssh *, u_char *, u_int32_t *seqnr_p);
int ssh_packet_read_poll2(struct ssh *, u_char *, uint32_t *seqnr_p);
int ssh_packet_process_incoming(struct ssh *, const char *buf, u_int len);
int ssh_packet_process_read(struct ssh *, int);
int ssh_packet_read_seqnr(struct ssh *, u_char *, u_int32_t *seqnr_p);
int ssh_packet_read_poll_seqnr(struct ssh *, u_char *, u_int32_t *seqnr_p);
int ssh_packet_read_seqnr(struct ssh *, u_char *, uint32_t *seqnr_p);
int ssh_packet_read_poll_seqnr(struct ssh *, u_char *, uint32_t *seqnr_p);
void ssh_packet_disconnect(struct ssh *, const char *fmt, ...)
__attribute__((format(printf, 2, 3)))
@@ -139,7 +139,7 @@ void ssh_packet_disconnect(struct ssh *, const char *fmt, ...)
void ssh_packet_send_debug(struct ssh *, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
int ssh_set_newkeys(struct ssh *, int mode);
void ssh_packet_get_bytes(struct ssh *, u_int64_t *, u_int64_t *);
void ssh_packet_get_bytes(struct ssh *, uint64_t *, uint64_t *);
int ssh_packet_write_poll(struct ssh *);
int ssh_packet_write_wait(struct ssh *);
@@ -168,7 +168,7 @@ int ssh_local_port(struct ssh *);
const char *ssh_packet_rdomain_in(struct ssh *);
char *ssh_remote_hostname(struct ssh *);
void ssh_packet_set_rekey_limits(struct ssh *, u_int64_t, u_int32_t);
void ssh_packet_set_rekey_limits(struct ssh *, uint64_t, uint32_t);
time_t ssh_packet_get_rekey_timeout(struct ssh *);
void *ssh_packet_get_input(struct ssh *);
@@ -188,8 +188,8 @@ int sshpkt_msg_ignore(struct ssh *, u_int);
int sshpkt_put(struct ssh *ssh, const void *v, size_t len);
int sshpkt_putb(struct ssh *ssh, const struct sshbuf *b);
int sshpkt_put_u8(struct ssh *ssh, u_char val);
int sshpkt_put_u32(struct ssh *ssh, u_int32_t val);
int sshpkt_put_u64(struct ssh *ssh, u_int64_t val);
int sshpkt_put_u32(struct ssh *ssh, uint32_t val);
int sshpkt_put_u64(struct ssh *ssh, uint64_t val);
int sshpkt_put_string(struct ssh *ssh, const void *v, size_t len);
int sshpkt_put_cstring(struct ssh *ssh, const void *v);
int sshpkt_put_stringb(struct ssh *ssh, const struct sshbuf *v);
@@ -199,8 +199,8 @@ int sshpkt_put_bignum2(struct ssh *ssh, const BIGNUM *v);
int sshpkt_get(struct ssh *ssh, void *valp, size_t len);
int sshpkt_get_u8(struct ssh *ssh, u_char *valp);
int sshpkt_get_u32(struct ssh *ssh, u_int32_t *valp);
int sshpkt_get_u64(struct ssh *ssh, u_int64_t *valp);
int sshpkt_get_u32(struct ssh *ssh, uint32_t *valp);
int sshpkt_get_u64(struct ssh *ssh, uint64_t *valp);
int sshpkt_get_string(struct ssh *ssh, u_char **valp, size_t *lenp);
int sshpkt_get_string_direct(struct ssh *ssh, const u_char **valp, size_t *lenp);
int sshpkt_peek_string_direct(struct ssh *ssh, const u_char **valp, size_t *lenp);
+2 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: servconf.h,v 1.175 2026/02/11 22:57:16 djm Exp $ */
/* $OpenBSD: servconf.h,v 1.176 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -242,7 +242,7 @@ typedef struct {
int fingerprint_hash;
int expose_userauth_info;
u_int64_t timing_secret;
uint64_t timing_secret;
char *sk_provider;
int required_rsa_size; /* minimum size of RSA keys */
+5 -5
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: serverloop.c,v 1.245 2025/10/30 03:19:54 djm Exp $ */
/* $OpenBSD: serverloop.c,v 1.246 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -402,7 +402,7 @@ server_loop2(struct ssh *ssh, Authctxt *authctxt)
}
static int
server_input_keep_alive(int type, u_int32_t seq, struct ssh *ssh)
server_input_keep_alive(int type, uint32_t seq, struct ssh *ssh)
{
debug("Got %d/%u for keepalive", type, seq);
/*
@@ -608,7 +608,7 @@ server_request_session(struct ssh *ssh)
}
static int
server_input_channel_open(int type, u_int32_t seq, struct ssh *ssh)
server_input_channel_open(int type, uint32_t seq, struct ssh *ssh)
{
Channel *c = NULL;
char *ctype = NULL;
@@ -752,7 +752,7 @@ server_input_hostkeys_prove(struct ssh *ssh, struct sshbuf **respp)
}
static int
server_input_global_request(int type, u_int32_t seq, struct ssh *ssh)
server_input_global_request(int type, uint32_t seq, struct ssh *ssh)
{
char *rtype = NULL;
u_char want_reply = 0;
@@ -857,7 +857,7 @@ server_input_global_request(int type, u_int32_t seq, struct ssh *ssh)
}
static int
server_input_channel_req(int type, u_int32_t seq, struct ssh *ssh)
server_input_channel_req(int type, uint32_t seq, struct ssh *ssh)
{
Channel *c;
int r, success = 0;
+12 -12
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: sftp-client.c,v 1.184 2026/02/18 03:04:12 djm Exp $ */
/* $OpenBSD: sftp-client.c,v 1.185 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -94,7 +94,7 @@ struct sftp_conn {
#define SFTP_EXT_COPY_DATA 0x00000100
#define SFTP_EXT_GETUSERSGROUPS_BY_ID 0x00000200
u_int exts;
u_int64_t limit_kbps;
uint64_t limit_kbps;
struct bwlimit bwlimit_in, bwlimit_out;
};
@@ -102,7 +102,7 @@ struct sftp_conn {
struct request {
u_int id;
size_t len;
u_int64_t offset;
uint64_t offset;
TAILQ_ENTRY(request) tq;
};
TAILQ_HEAD(requests, request);
@@ -388,7 +388,7 @@ get_decode_statvfs(struct sftp_conn *conn, struct sftp_statvfs *st,
struct sshbuf *msg;
u_char type;
u_int id;
u_int64_t flag;
uint64_t flag;
int r;
if ((msg = sshbuf_new()) == NULL)
@@ -442,7 +442,7 @@ get_decode_statvfs(struct sftp_conn *conn, struct sftp_statvfs *st,
struct sftp_conn *
sftp_init(int fd_in, int fd_out, u_int transfer_buflen, u_int num_requests,
u_int64_t limit_kbps)
uint64_t limit_kbps)
{
u_char type;
struct sshbuf *msg;
@@ -1504,7 +1504,7 @@ sftp_lsetstat(struct sftp_conn *conn, const char *path, Attrib *a)
}
static void
send_read_request(struct sftp_conn *conn, u_int id, u_int64_t offset,
send_read_request(struct sftp_conn *conn, u_int id, uint64_t offset,
u_int len, const u_char *handle, u_int handle_len)
{
struct sshbuf *msg;
@@ -1587,7 +1587,7 @@ sftp_download(struct sftp_conn *conn, const char *remote_path,
u_char *handle;
int local_fd = -1, write_error;
int read_error, write_errno, lmodified = 0, reordered = 0, r;
u_int64_t offset = 0, size, highwater = 0, maxack = 0;
uint64_t offset = 0, size, highwater = 0, maxack = 0;
u_int mode, id, buflen, num_req, max_req, status = SSH2_FX_OK;
off_t progress_counter;
size_t handle_len;
@@ -1648,7 +1648,7 @@ sftp_download(struct sftp_conn *conn, const char *remote_path,
error("\"%s\" has negative size", local_path);
goto fail;
}
if ((u_int64_t)st.st_size > size) {
if ((uint64_t)st.st_size > size) {
error("Unable to resume download of \"%s\": "
"local file is larger than remote", local_path);
fail:
@@ -2025,8 +2025,8 @@ sftp_upload(struct sftp_conn *conn, const char *local_path,
struct sshbuf *msg;
struct stat sb;
Attrib a, t, c;
u_int32_t startid, ackid;
u_int64_t highwater = 0, maxack = 0;
uint32_t startid, ackid;
uint64_t highwater = 0, maxack = 0;
struct request *ack = NULL;
struct requests acks;
size_t handle_len;
@@ -2245,7 +2245,7 @@ upload_dir_internal(struct sftp_conn *conn, const char *src, const char *dst,
char *filename, *new_src = NULL, *new_dst = NULL;
struct stat sb;
Attrib a, dirattrib;
u_int32_t saved_perm;
uint32_t saved_perm;
debug2_f("upload local dir \"%s\" to remote \"%s\"", src, dst);
@@ -2447,7 +2447,7 @@ sftp_crossload(struct sftp_conn *from, struct sftp_conn *to,
{
struct sshbuf *msg;
int write_error, read_error, r;
u_int64_t offset = 0, size;
uint64_t offset = 0, size;
u_int id, buflen, num_req, max_req, status = SSH2_FX_OK;
u_int num_upload_req;
off_t progress_counter;
+17 -17
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: sftp-client.h,v 1.40 2025/09/15 05:17:37 djm Exp $ */
/* $OpenBSD: sftp-client.h,v 1.41 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
@@ -34,25 +34,25 @@ struct SFTP_DIRENT {
* server's native format may be larger than the client's.
*/
struct sftp_statvfs {
u_int64_t f_bsize;
u_int64_t f_frsize;
u_int64_t f_blocks;
u_int64_t f_bfree;
u_int64_t f_bavail;
u_int64_t f_files;
u_int64_t f_ffree;
u_int64_t f_favail;
u_int64_t f_fsid;
u_int64_t f_flag;
u_int64_t f_namemax;
uint64_t f_bsize;
uint64_t f_frsize;
uint64_t f_blocks;
uint64_t f_bfree;
uint64_t f_bavail;
uint64_t f_files;
uint64_t f_ffree;
uint64_t f_favail;
uint64_t f_fsid;
uint64_t f_flag;
uint64_t f_namemax;
};
/* Used for limits response on the wire from the server */
struct sftp_limits {
u_int64_t packet_length;
u_int64_t read_length;
u_int64_t write_length;
u_int64_t open_handles;
uint64_t packet_length;
uint64_t read_length;
uint64_t write_length;
uint64_t open_handles;
};
/* print flag values */
@@ -64,7 +64,7 @@ struct sftp_limits {
* Initialise a SSH filexfer connection. Returns NULL on error or
* a pointer to a initialized sftp_conn struct on success.
*/
struct sftp_conn *sftp_init(int, int, u_int, u_int, u_int64_t);
struct sftp_conn *sftp_init(int, int, u_int, u_int, uint64_t);
void sftp_free(struct sftp_conn *);
u_int sftp_proto_version(struct sftp_conn *);
+8 -8
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: sftp-common.h,v 1.13 2022/09/19 10:41:58 djm Exp $ */
/* $OpenBSD: sftp-common.h,v 1.14 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -33,13 +33,13 @@ typedef struct Attrib Attrib;
/* File attributes */
struct Attrib {
u_int32_t flags;
u_int64_t size;
u_int32_t uid;
u_int32_t gid;
u_int32_t perm;
u_int32_t atime;
u_int32_t mtime;
uint32_t flags;
uint64_t size;
uint32_t uid;
uint32_t gid;
uint32_t perm;
uint32_t atime;
uint32_t mtime;
};
void attrib_clear(Attrib *);
+83 -83
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: sftp-server.c,v 1.152 2026/02/13 19:06:18 dtucker Exp $ */
/* $OpenBSD: sftp-server.c,v 1.153 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2000-2004 Markus Friedl. All rights reserved.
*
@@ -87,42 +87,42 @@ struct Stat {
};
/* Packet handlers */
static void process_open(u_int32_t id);
static void process_close(u_int32_t id);
static void process_read(u_int32_t id);
static void process_write(u_int32_t id);
static void process_stat(u_int32_t id);
static void process_lstat(u_int32_t id);
static void process_fstat(u_int32_t id);
static void process_setstat(u_int32_t id);
static void process_fsetstat(u_int32_t id);
static void process_opendir(u_int32_t id);
static void process_readdir(u_int32_t id);
static void process_remove(u_int32_t id);
static void process_mkdir(u_int32_t id);
static void process_rmdir(u_int32_t id);
static void process_realpath(u_int32_t id);
static void process_rename(u_int32_t id);
static void process_readlink(u_int32_t id);
static void process_symlink(u_int32_t id);
static void process_extended_posix_rename(u_int32_t id);
static void process_extended_statvfs(u_int32_t id);
static void process_extended_fstatvfs(u_int32_t id);
static void process_extended_hardlink(u_int32_t id);
static void process_extended_fsync(u_int32_t id);
static void process_extended_lsetstat(u_int32_t id);
static void process_extended_limits(u_int32_t id);
static void process_extended_expand(u_int32_t id);
static void process_extended_copy_data(u_int32_t id);
static void process_extended_home_directory(u_int32_t id);
static void process_extended_get_users_groups_by_id(u_int32_t id);
static void process_extended(u_int32_t id);
static void process_open(uint32_t id);
static void process_close(uint32_t id);
static void process_read(uint32_t id);
static void process_write(uint32_t id);
static void process_stat(uint32_t id);
static void process_lstat(uint32_t id);
static void process_fstat(uint32_t id);
static void process_setstat(uint32_t id);
static void process_fsetstat(uint32_t id);
static void process_opendir(uint32_t id);
static void process_readdir(uint32_t id);
static void process_remove(uint32_t id);
static void process_mkdir(uint32_t id);
static void process_rmdir(uint32_t id);
static void process_realpath(uint32_t id);
static void process_rename(uint32_t id);
static void process_readlink(uint32_t id);
static void process_symlink(uint32_t id);
static void process_extended_posix_rename(uint32_t id);
static void process_extended_statvfs(uint32_t id);
static void process_extended_fstatvfs(uint32_t id);
static void process_extended_hardlink(uint32_t id);
static void process_extended_fsync(uint32_t id);
static void process_extended_lsetstat(uint32_t id);
static void process_extended_limits(uint32_t id);
static void process_extended_expand(uint32_t id);
static void process_extended_copy_data(uint32_t id);
static void process_extended_home_directory(uint32_t id);
static void process_extended_get_users_groups_by_id(uint32_t id);
static void process_extended(uint32_t id);
struct sftp_handler {
const char *name; /* user-visible name for fine-grained perms */
const char *ext_name; /* extended request name */
u_int type; /* packet type, for non extended packets */
void (*handler)(u_int32_t);
void (*handler)(uint32_t);
int does_write; /* if nonzero, banned for readonly mode */
};
@@ -305,7 +305,7 @@ struct Handle {
int fd;
int flags;
char *name;
u_int64_t bytes_read, bytes_write;
uint64_t bytes_read, bytes_write;
int next_unused;
};
@@ -430,7 +430,7 @@ handle_update_write(int handle, ssize_t bytes)
handles[handle].bytes_write += bytes;
}
static u_int64_t
static uint64_t
handle_bytes_read(int handle)
{
if (handle_is_ok(handle, HANDLE_FILE))
@@ -438,7 +438,7 @@ handle_bytes_read(int handle)
return 0;
}
static u_int64_t
static uint64_t
handle_bytes_write(int handle)
{
if (handle_is_ok(handle, HANDLE_FILE))
@@ -520,7 +520,7 @@ send_msg(struct sshbuf *m)
}
static const char *
status_to_message(u_int32_t status)
status_to_message(uint32_t status)
{
static const char * const status_messages[] = {
"Success", /* SSH_FX_OK */
@@ -538,7 +538,7 @@ status_to_message(u_int32_t status)
}
static void
send_status_errmsg(u_int32_t id, u_int32_t status, const char *errmsg)
send_status_errmsg(uint32_t id, uint32_t status, const char *errmsg)
{
struct sshbuf *msg;
int r;
@@ -564,13 +564,13 @@ send_status_errmsg(u_int32_t id, u_int32_t status, const char *errmsg)
}
static void
send_status(u_int32_t id, u_int32_t status)
send_status(uint32_t id, uint32_t status)
{
send_status_errmsg(id, status, NULL);
}
static void
send_data_or_handle(char type, u_int32_t id, const u_char *data, int dlen)
send_data_or_handle(char type, uint32_t id, const u_char *data, int dlen)
{
struct sshbuf *msg;
int r;
@@ -586,14 +586,14 @@ send_data_or_handle(char type, u_int32_t id, const u_char *data, int dlen)
}
static void
send_data(u_int32_t id, const u_char *data, int dlen)
send_data(uint32_t id, const u_char *data, int dlen)
{
debug("request %u: sent data len %d", id, dlen);
send_data_or_handle(SSH2_FXP_DATA, id, data, dlen);
}
static void
send_handle(u_int32_t id, int handle)
send_handle(uint32_t id, int handle)
{
u_char *string;
int hlen;
@@ -605,7 +605,7 @@ send_handle(u_int32_t id, int handle)
}
static void
send_names(u_int32_t id, int count, const Stat *stats)
send_names(uint32_t id, int count, const Stat *stats)
{
struct sshbuf *msg;
int i, r;
@@ -628,7 +628,7 @@ send_names(u_int32_t id, int count, const Stat *stats)
}
static void
send_attrib(u_int32_t id, const Attrib *a)
send_attrib(uint32_t id, const Attrib *a)
{
struct sshbuf *msg;
int r;
@@ -645,10 +645,10 @@ send_attrib(u_int32_t id, const Attrib *a)
}
static void
send_statvfs(u_int32_t id, struct statvfs *st)
send_statvfs(uint32_t id, struct statvfs *st)
{
struct sshbuf *msg;
u_int64_t flag;
uint64_t flag;
int r;
flag = (st->f_flag & ST_RDONLY) ? SSH2_FXE_STATVFS_ST_RDONLY : 0;
@@ -731,9 +731,9 @@ process_init(void)
}
static void
process_open(u_int32_t id)
process_open(uint32_t id)
{
u_int32_t pflags;
uint32_t pflags;
Attrib a;
char *name;
int r, handle, fd, flags, mode, status = SSH2_FX_FAILURE;
@@ -773,7 +773,7 @@ process_open(u_int32_t id)
}
static void
process_close(u_int32_t id)
process_close(uint32_t id)
{
int r, handle, ret, status = SSH2_FX_FAILURE;
@@ -788,13 +788,13 @@ process_close(u_int32_t id)
}
static void
process_read(u_int32_t id)
process_read(uint32_t id)
{
static u_char *buf;
static size_t buflen;
u_int32_t len;
uint32_t len;
int r, handle, fd, ret, status = SSH2_FX_FAILURE;
u_int64_t off;
uint64_t off;
if ((r = get_handle(iqueue, &handle)) != 0 ||
(r = sshbuf_get_u64(iqueue, &off)) != 0 ||
@@ -843,9 +843,9 @@ process_read(u_int32_t id)
}
static void
process_write(u_int32_t id)
process_write(uint32_t id)
{
u_int64_t off;
uint64_t off;
size_t len;
int r, handle, fd, ret, status;
u_char *data;
@@ -888,7 +888,7 @@ process_write(u_int32_t id)
}
static void
process_do_stat(u_int32_t id, int do_lstat)
process_do_stat(uint32_t id, int do_lstat)
{
Attrib a;
struct stat st;
@@ -914,19 +914,19 @@ process_do_stat(u_int32_t id, int do_lstat)
}
static void
process_stat(u_int32_t id)
process_stat(uint32_t id)
{
process_do_stat(id, 0);
}
static void
process_lstat(u_int32_t id)
process_lstat(uint32_t id)
{
process_do_stat(id, 1);
}
static void
process_fstat(u_int32_t id)
process_fstat(uint32_t id)
{
Attrib a;
struct stat st;
@@ -976,7 +976,7 @@ attrib_to_ts(const Attrib *a)
}
static void
process_setstat(u_int32_t id)
process_setstat(uint32_t id)
{
Attrib a;
char *name;
@@ -1023,7 +1023,7 @@ process_setstat(u_int32_t id)
}
static void
process_fsetstat(u_int32_t id)
process_fsetstat(uint32_t id)
{
Attrib a;
int handle, fd, r;
@@ -1088,7 +1088,7 @@ process_fsetstat(u_int32_t id)
}
static void
process_opendir(u_int32_t id)
process_opendir(uint32_t id)
{
DIR *dirp = NULL;
char *path;
@@ -1118,7 +1118,7 @@ process_opendir(u_int32_t id)
}
static void
process_readdir(u_int32_t id)
process_readdir(uint32_t id)
{
DIR *dirp;
struct dirent *dp;
@@ -1175,7 +1175,7 @@ process_readdir(u_int32_t id)
}
static void
process_remove(u_int32_t id)
process_remove(uint32_t id)
{
char *name;
int r, status = SSH2_FX_FAILURE;
@@ -1192,7 +1192,7 @@ process_remove(u_int32_t id)
}
static void
process_mkdir(u_int32_t id)
process_mkdir(uint32_t id)
{
Attrib a;
char *name;
@@ -1213,7 +1213,7 @@ process_mkdir(u_int32_t id)
}
static void
process_rmdir(u_int32_t id)
process_rmdir(uint32_t id)
{
char *name;
int r, status;
@@ -1230,7 +1230,7 @@ process_rmdir(u_int32_t id)
}
static void
process_realpath(u_int32_t id)
process_realpath(uint32_t id)
{
char resolvedname[PATH_MAX];
char *path;
@@ -1257,7 +1257,7 @@ process_realpath(u_int32_t id)
}
static void
process_rename(u_int32_t id)
process_rename(uint32_t id)
{
char *oldpath, *newpath;
int r, status;
@@ -1317,7 +1317,7 @@ process_rename(u_int32_t id)
}
static void
process_readlink(u_int32_t id)
process_readlink(uint32_t id)
{
int r, len;
char buf[PATH_MAX];
@@ -1342,7 +1342,7 @@ process_readlink(u_int32_t id)
}
static void
process_symlink(u_int32_t id)
process_symlink(uint32_t id)
{
char *oldpath, *newpath;
int r, status;
@@ -1362,7 +1362,7 @@ process_symlink(u_int32_t id)
}
static void
process_extended_posix_rename(u_int32_t id)
process_extended_posix_rename(uint32_t id)
{
char *oldpath, *newpath;
int r, status;
@@ -1381,7 +1381,7 @@ process_extended_posix_rename(u_int32_t id)
}
static void
process_extended_statvfs(u_int32_t id)
process_extended_statvfs(uint32_t id)
{
char *path;
struct statvfs st;
@@ -1400,7 +1400,7 @@ process_extended_statvfs(u_int32_t id)
}
static void
process_extended_fstatvfs(u_int32_t id)
process_extended_fstatvfs(uint32_t id)
{
int r, handle, fd;
struct statvfs st;
@@ -1420,7 +1420,7 @@ process_extended_fstatvfs(u_int32_t id)
}
static void
process_extended_hardlink(u_int32_t id)
process_extended_hardlink(uint32_t id)
{
char *oldpath, *newpath;
int r, status;
@@ -1439,7 +1439,7 @@ process_extended_hardlink(u_int32_t id)
}
static void
process_extended_fsync(u_int32_t id)
process_extended_fsync(uint32_t id)
{
int handle, fd, r, status = SSH2_FX_OP_UNSUPPORTED;
@@ -1457,7 +1457,7 @@ process_extended_fsync(u_int32_t id)
}
static void
process_extended_lsetstat(u_int32_t id)
process_extended_lsetstat(uint32_t id)
{
Attrib a;
char *name;
@@ -1506,7 +1506,7 @@ process_extended_lsetstat(u_int32_t id)
}
static void
process_extended_limits(u_int32_t id)
process_extended_limits(uint32_t id)
{
struct sshbuf *msg;
int r;
@@ -1540,7 +1540,7 @@ process_extended_limits(u_int32_t id)
}
static void
process_extended_expand(u_int32_t id)
process_extended_expand(uint32_t id)
{
char cwd[PATH_MAX], resolvedname[PATH_MAX];
char *path, *npath;
@@ -1599,11 +1599,11 @@ process_extended_expand(u_int32_t id)
}
static void
process_extended_copy_data(u_int32_t id)
process_extended_copy_data(uint32_t id)
{
u_char buf[64*1024];
int read_handle, read_fd, write_handle, write_fd;
u_int64_t len, read_off, read_len, write_off;
uint64_t len, read_off, read_len, write_off;
int r, copy_until_eof, status = SSH2_FX_OP_UNSUPPORTED;
size_t ret;
@@ -1623,7 +1623,7 @@ process_extended_copy_data(u_int32_t id)
/* For read length of 0, we read until EOF. */
if (read_len == 0) {
read_len = (u_int64_t)-1 - read_off;
read_len = (uint64_t)-1 - read_off;
copy_until_eof = 1;
} else
copy_until_eof = 0;
@@ -1687,7 +1687,7 @@ process_extended_copy_data(u_int32_t id)
}
static void
process_extended_home_directory(u_int32_t id)
process_extended_home_directory(uint32_t id)
{
char *username;
struct passwd *user_pw;
@@ -1714,7 +1714,7 @@ process_extended_home_directory(u_int32_t id)
}
static void
process_extended_get_users_groups_by_id(u_int32_t id)
process_extended_get_users_groups_by_id(uint32_t id)
{
struct passwd *user_pw;
struct group *gr;
@@ -1769,7 +1769,7 @@ process_extended_get_users_groups_by_id(u_int32_t id)
}
static void
process_extended(u_int32_t id)
process_extended(uint32_t id)
{
char *request;
int r;
@@ -1800,7 +1800,7 @@ process(void)
u_char type;
const u_char *cp;
int i, r;
u_int32_t id;
uint32_t id;
buf_len = sshbuf_len(iqueue);
if (buf_len < 5)
+16 -16
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: ssh-keygen.c,v 1.489 2026/02/11 17:05:32 dtucker Exp $ */
/* $OpenBSD: ssh-keygen.c,v 1.490 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -109,8 +109,8 @@ static char *cert_key_id = NULL;
static char *cert_principals = NULL;
/* Validity period for certificates */
static u_int64_t cert_valid_from = 0;
static u_int64_t cert_valid_to = ~0ULL;
static uint64_t cert_valid_from = 0;
static uint64_t cert_valid_to = ~0ULL;
/* Certificate options */
#define CERTOPT_X_FWD (1)
@@ -122,7 +122,7 @@ static u_int64_t cert_valid_to = ~0ULL;
#define CERTOPT_REQUIRE_VERIFY (1<<6)
#define CERTOPT_DEFAULT (CERTOPT_X_FWD|CERTOPT_AGENT_FWD| \
CERTOPT_PORT_FWD|CERTOPT_PTY|CERTOPT_USER_RC)
static u_int32_t certflags_flags = CERTOPT_DEFAULT;
static uint32_t certflags_flags = CERTOPT_DEFAULT;
static char *certflags_command = NULL;
static char *certflags_src_addr = NULL;
@@ -166,13 +166,13 @@ static char hostname[NI_MAXHOST];
#ifdef WITH_OPENSSL
/* moduli.c */
int gen_candidates(FILE *, u_int32_t, BIGNUM *);
int prime_test(FILE *, FILE *, u_int32_t, u_int32_t, char *, unsigned long,
int gen_candidates(FILE *, uint32_t, BIGNUM *);
int prime_test(FILE *, FILE *, uint32_t, uint32_t, char *, unsigned long,
unsigned long);
#endif
static void
type_bits_valid(int type, const char *name, u_int32_t *bitsp)
type_bits_valid(int type, const char *name, uint32_t *bitsp)
{
if (type == KEY_UNSPEC)
fatal("unknown key type %s", key_type_name);
@@ -1018,7 +1018,7 @@ do_gen_all_hostkeys(struct passwd *pw)
{ NULL, NULL, NULL }
};
u_int32_t bits = 0;
uint32_t bits = 0;
int first = 0;
struct stat st;
struct sshkey *private, *public;
@@ -1806,7 +1806,7 @@ do_ca_sign(struct passwd *pw, const char *ca_key_path, int prefer_agent,
if ((r = sshkey_to_certified(public)) != 0)
fatal_r(r, "Could not upgrade key %s to certificate", tmp);
public->cert->type = cert_key_type;
public->cert->serial = (u_int64_t)cert_serial;
public->cert->serial = (uint64_t)cert_serial;
public->cert->key_id = xstrdup(cert_key_id);
public->cert->nprincipals = n;
public->cert->principals = plist;
@@ -1875,7 +1875,7 @@ do_ca_sign(struct passwd *pw, const char *ca_key_path, int prefer_agent,
#endif
}
static u_int64_t
static uint64_t
parse_relative_time(const char *s, time_t now)
{
int64_t mul, secs;
@@ -1886,7 +1886,7 @@ parse_relative_time(const char *s, time_t now)
fatal("Invalid relative certificate time %s", s);
if (mul == -1 && secs > now)
fatal("Certificate time %s cannot be represented", s);
return now + (u_int64_t)(secs * mul);
return now + (uint64_t)(secs * mul);
}
static void
@@ -1947,7 +1947,7 @@ parse_cert_times(char *timespec)
if (*to == '-' || *to == '+')
cert_valid_to = parse_relative_time(to, now);
else if (strcmp(to, "forever") == 0)
cert_valid_to = ~(u_int64_t)0;
cert_valid_to = ~(uint64_t)0;
else if (strncmp(to, "0x", 2) == 0)
parse_hex_u64(to, &cert_valid_to);
else if (parse_absolute_time(to, &cert_valid_to) != 0)
@@ -2963,7 +2963,7 @@ do_moduli_screen(const char *out_file, char **opts, size_t nopts)
#ifdef WITH_OPENSSL
/* Moduli generation/screening */
char *checkpoint = NULL;
u_int32_t generator_wanted = 0;
uint32_t generator_wanted = 0;
unsigned long start_lineno = 0, lines_to_process = 0;
int prime_tests = 0;
FILE *out, *in = stdin;
@@ -2980,7 +2980,7 @@ do_moduli_screen(const char *out_file, char **opts, size_t nopts)
free(checkpoint);
checkpoint = xstrdup(p);
} else if ((p = strprefix(opts[i], "generator=", 0)) != NULL) {
generator_wanted = (u_int32_t)strtonum(p, 1, UINT_MAX,
generator_wanted = (uint32_t)strtonum(p, 1, UINT_MAX,
&errstr);
if (errstr != NULL) {
fatal("Generator invalid: %s (%s)", p, errstr);
@@ -3305,7 +3305,7 @@ main(int argc, char **argv)
char *sk_attestation_path = NULL;
struct sshbuf *challenge = NULL, *attest = NULL;
size_t i, nopts = 0;
u_int32_t bits = 0;
uint32_t bits = 0;
uint8_t sk_flags = SSH_SK_USER_PRESENCE_REQD;
const char *errstr, *p;
int log_level = SYSLOG_LEVEL_INFO;
@@ -3344,7 +3344,7 @@ main(int argc, char **argv)
gen_all_hostkeys = 1;
break;
case 'b':
bits = (u_int32_t)strtonum(optarg, 1, UINT32_MAX,
bits = (uint32_t)strtonum(optarg, 1, UINT32_MAX,
&errstr);
if (errstr)
fatal("Bits has bad value %s (%s)",
+5 -5
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: ssh-pkcs11.c,v 1.77 2026/02/14 00:18:34 jsg Exp $ */
/* $OpenBSD: ssh-pkcs11.c,v 1.78 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2010 Markus Friedl. All rights reserved.
* Copyright (c) 2014 Pedro Martelletto. All rights reserved.
@@ -1649,7 +1649,7 @@ fail:
static struct sshkey *
pkcs11_rsa_generate_private_key(struct pkcs11_provider *p, CK_ULONG slotidx,
char *label, CK_ULONG bits, CK_BYTE keyid, u_int32_t *err)
char *label, CK_ULONG bits, CK_BYTE keyid, uint32_t *err)
{
struct pkcs11_slotinfo *si;
char *plabel = label ? label : "";
@@ -1769,7 +1769,7 @@ static struct ec_curve_info {
static struct sshkey *
pkcs11_ecdsa_generate_private_key(struct pkcs11_provider *p, CK_ULONG slotidx,
char *label, CK_ULONG bits, CK_BYTE keyid, u_int32_t *err)
char *label, CK_ULONG bits, CK_BYTE keyid, uint32_t *err)
{
struct pkcs11_slotinfo *si;
char *plabel = label ? label : "";
@@ -2101,7 +2101,7 @@ pkcs11_key_free(struct sshkey *key)
#ifdef WITH_PKCS11_KEYGEN
struct sshkey *
pkcs11_gakp(char *provider_id, char *pin, unsigned int slotidx, char *label,
unsigned int type, unsigned int bits, unsigned char keyid, u_int32_t *err)
unsigned int type, unsigned int bits, unsigned char keyid, uint32_t *err)
{
struct pkcs11_provider *p = NULL;
struct pkcs11_slotinfo *si;
@@ -2167,7 +2167,7 @@ out:
struct sshkey *
pkcs11_destroy_keypair(char *provider_id, char *pin, unsigned long slotidx,
unsigned char keyid, u_int32_t *err)
unsigned char keyid, uint32_t *err)
{
struct pkcs11_provider *p = NULL;
struct pkcs11_slotinfo *si;
+3 -3
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: ssh-pkcs11.h,v 1.10 2025/10/15 23:54:20 djm Exp $ */
/* $OpenBSD: ssh-pkcs11.h,v 1.11 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2010 Markus Friedl. All rights reserved.
*
@@ -38,10 +38,10 @@ void pkcs11_key_free(struct sshkey *);
#ifdef WITH_PKCS11_KEYGEN
struct sshkey *
pkcs11_gakp(char *, char *, unsigned int, char *, unsigned int,
unsigned int, unsigned char, u_int32_t *);
unsigned int, unsigned char, uint32_t *);
struct sshkey *
pkcs11_destroy_keypair(char *, char *, unsigned long, unsigned char,
u_int32_t *);
uint32_t *);
#endif
/* Only available in ssh-pkcs11-client.c */
+2 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: ssh.c,v 1.626 2026/02/16 23:47:06 jsg Exp $ */
/* $OpenBSD: ssh.c,v 1.627 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1950,7 +1950,7 @@ forwarding_success(void)
/* Callback for remote forward global requests */
static void
ssh_confirm_remote_forward(struct ssh *ssh, int type, u_int32_t seq, void *ctxt)
ssh_confirm_remote_forward(struct ssh *ssh, int type, uint32_t seq, void *ctxt)
{
struct Forward *rfwd = (struct Forward *)ctxt;
u_int port;
+2 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: ssh_api.c,v 1.33 2025/11/13 10:35:14 dtucker Exp $ */
/* $OpenBSD: ssh_api.c,v 1.34 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2012 Markus Friedl. All rights reserved.
*
@@ -255,7 +255,7 @@ int
ssh_packet_next(struct ssh *ssh, u_char *typep)
{
int r;
u_int32_t seqnr;
uint32_t seqnr;
u_char type;
/*
+16 -16
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: sshbuf-getput-basic.c,v 1.14 2025/11/21 01:29:06 djm Exp $ */
/* $OpenBSD: sshbuf-getput-basic.c,v 1.15 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2011 Damien Miller
*
@@ -43,7 +43,7 @@ sshbuf_get(struct sshbuf *buf, void *v, size_t len)
}
int
sshbuf_get_u64(struct sshbuf *buf, u_int64_t *valp)
sshbuf_get_u64(struct sshbuf *buf, uint64_t *valp)
{
const u_char *p = sshbuf_ptr(buf);
int r;
@@ -56,7 +56,7 @@ sshbuf_get_u64(struct sshbuf *buf, u_int64_t *valp)
}
int
sshbuf_get_u32(struct sshbuf *buf, u_int32_t *valp)
sshbuf_get_u32(struct sshbuf *buf, uint32_t *valp)
{
const u_char *p = sshbuf_ptr(buf);
int r;
@@ -69,7 +69,7 @@ sshbuf_get_u32(struct sshbuf *buf, u_int32_t *valp)
}
int
sshbuf_get_u16(struct sshbuf *buf, u_int16_t *valp)
sshbuf_get_u16(struct sshbuf *buf, uint16_t *valp)
{
const u_char *p = sshbuf_ptr(buf);
int r;
@@ -90,7 +90,7 @@ sshbuf_get_u8(struct sshbuf *buf, u_char *valp)
if ((r = sshbuf_consume(buf, 1)) < 0)
return r;
if (valp != NULL)
*valp = (u_int8_t)*p;
*valp = (uint8_t)*p;
return 0;
}
@@ -122,7 +122,7 @@ check_roffset(const struct sshbuf *buf, size_t offset, size_t len,
}
int
sshbuf_peek_u64(const struct sshbuf *buf, size_t offset, u_int64_t *valp)
sshbuf_peek_u64(const struct sshbuf *buf, size_t offset, uint64_t *valp)
{
const u_char *p = NULL;
int r;
@@ -137,7 +137,7 @@ sshbuf_peek_u64(const struct sshbuf *buf, size_t offset, u_int64_t *valp)
}
int
sshbuf_peek_u32(const struct sshbuf *buf, size_t offset, u_int32_t *valp)
sshbuf_peek_u32(const struct sshbuf *buf, size_t offset, uint32_t *valp)
{
const u_char *p = NULL;
int r;
@@ -152,7 +152,7 @@ sshbuf_peek_u32(const struct sshbuf *buf, size_t offset, u_int32_t *valp)
}
int
sshbuf_peek_u16(const struct sshbuf *buf, size_t offset, u_int16_t *valp)
sshbuf_peek_u16(const struct sshbuf *buf, size_t offset, uint16_t *valp)
{
const u_char *p = NULL;
int r;
@@ -238,7 +238,7 @@ int
sshbuf_peek_string_direct(const struct sshbuf *buf, const u_char **valp,
size_t *lenp)
{
u_int32_t len;
uint32_t len;
const u_char *p = sshbuf_ptr(buf);
if (valp != NULL)
@@ -303,7 +303,7 @@ sshbuf_get_cstring(struct sshbuf *buf, char **valp, size_t *lenp)
int
sshbuf_get_stringb(struct sshbuf *buf, struct sshbuf *v)
{
u_int32_t len;
uint32_t len;
u_char *p;
int r;
@@ -387,7 +387,7 @@ sshbuf_putfv(struct sshbuf *buf, const char *fmt, va_list ap)
}
int
sshbuf_put_u64(struct sshbuf *buf, u_int64_t val)
sshbuf_put_u64(struct sshbuf *buf, uint64_t val)
{
u_char *p;
int r;
@@ -399,7 +399,7 @@ sshbuf_put_u64(struct sshbuf *buf, u_int64_t val)
}
int
sshbuf_put_u32(struct sshbuf *buf, u_int32_t val)
sshbuf_put_u32(struct sshbuf *buf, uint32_t val)
{
u_char *p;
int r;
@@ -411,7 +411,7 @@ sshbuf_put_u32(struct sshbuf *buf, u_int32_t val)
}
int
sshbuf_put_u16(struct sshbuf *buf, u_int16_t val)
sshbuf_put_u16(struct sshbuf *buf, uint16_t val)
{
u_char *p;
int r;
@@ -449,7 +449,7 @@ check_woffset(struct sshbuf *buf, size_t offset, size_t len, u_char **p)
}
int
sshbuf_poke_u64(struct sshbuf *buf, size_t offset, u_int64_t val)
sshbuf_poke_u64(struct sshbuf *buf, size_t offset, uint64_t val)
{
u_char *p = NULL;
int r;
@@ -461,7 +461,7 @@ sshbuf_poke_u64(struct sshbuf *buf, size_t offset, u_int64_t val)
}
int
sshbuf_poke_u32(struct sshbuf *buf, size_t offset, u_int32_t val)
sshbuf_poke_u32(struct sshbuf *buf, size_t offset, uint32_t val)
{
u_char *p = NULL;
int r;
@@ -473,7 +473,7 @@ sshbuf_poke_u32(struct sshbuf *buf, size_t offset, u_int32_t val)
}
int
sshbuf_poke_u16(struct sshbuf *buf, size_t offset, u_int16_t val)
sshbuf_poke_u16(struct sshbuf *buf, size_t offset, uint16_t val)
{
u_char *p = NULL;
int r;
+30 -30
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: sshbuf.h,v 1.34 2025/12/29 23:52:09 djm Exp $ */
/* $OpenBSD: sshbuf.h,v 1.35 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2011 Damien Miller
*
@@ -173,22 +173,22 @@ int sshbuf_putf(struct sshbuf *buf, const char *fmt, ...)
int sshbuf_putfv(struct sshbuf *buf, const char *fmt, va_list ap);
/* Functions to extract or store big-endian words of various sizes */
int sshbuf_get_u64(struct sshbuf *buf, u_int64_t *valp);
int sshbuf_get_u32(struct sshbuf *buf, u_int32_t *valp);
int sshbuf_get_u16(struct sshbuf *buf, u_int16_t *valp);
int sshbuf_get_u64(struct sshbuf *buf, uint64_t *valp);
int sshbuf_get_u32(struct sshbuf *buf, uint32_t *valp);
int sshbuf_get_u16(struct sshbuf *buf, uint16_t *valp);
int sshbuf_get_u8(struct sshbuf *buf, u_char *valp);
int sshbuf_put_u64(struct sshbuf *buf, u_int64_t val);
int sshbuf_put_u32(struct sshbuf *buf, u_int32_t val);
int sshbuf_put_u16(struct sshbuf *buf, u_int16_t val);
int sshbuf_put_u64(struct sshbuf *buf, uint64_t val);
int sshbuf_put_u32(struct sshbuf *buf, uint32_t val);
int sshbuf_put_u16(struct sshbuf *buf, uint16_t val);
int sshbuf_put_u8(struct sshbuf *buf, u_char val);
/* Functions to peek at the contents of a buffer without modifying it. */
int sshbuf_peek_u64(const struct sshbuf *buf, size_t offset,
u_int64_t *valp);
uint64_t *valp);
int sshbuf_peek_u32(const struct sshbuf *buf, size_t offset,
u_int32_t *valp);
uint32_t *valp);
int sshbuf_peek_u16(const struct sshbuf *buf, size_t offset,
u_int16_t *valp);
uint16_t *valp);
int sshbuf_peek_u8(const struct sshbuf *buf, size_t offset,
u_char *valp);
@@ -196,9 +196,9 @@ int sshbuf_peek_u8(const struct sshbuf *buf, size_t offset,
* Functions to poke values into an existing buffer (e.g. a length header
* to a packet). The destination bytes must already exist in the buffer.
*/
int sshbuf_poke_u64(struct sshbuf *buf, size_t offset, u_int64_t val);
int sshbuf_poke_u32(struct sshbuf *buf, size_t offset, u_int32_t val);
int sshbuf_poke_u16(struct sshbuf *buf, size_t offset, u_int16_t val);
int sshbuf_poke_u64(struct sshbuf *buf, size_t offset, uint64_t val);
int sshbuf_poke_u32(struct sshbuf *buf, size_t offset, uint32_t val);
int sshbuf_poke_u16(struct sshbuf *buf, size_t offset, uint16_t val);
int sshbuf_poke_u8(struct sshbuf *buf, size_t offset, u_char val);
int sshbuf_poke(struct sshbuf *buf, size_t offset, void *v, size_t len);
@@ -337,26 +337,26 @@ int sshbuf_read(int, struct sshbuf *, size_t, size_t *)
/* Macros for decoding/encoding integers */
#define PEEK_U64(p) \
(((u_int64_t)(((const u_char *)(p))[0]) << 56) | \
((u_int64_t)(((const u_char *)(p))[1]) << 48) | \
((u_int64_t)(((const u_char *)(p))[2]) << 40) | \
((u_int64_t)(((const u_char *)(p))[3]) << 32) | \
((u_int64_t)(((const u_char *)(p))[4]) << 24) | \
((u_int64_t)(((const u_char *)(p))[5]) << 16) | \
((u_int64_t)(((const u_char *)(p))[6]) << 8) | \
(u_int64_t)(((const u_char *)(p))[7]))
(((uint64_t)(((const u_char *)(p))[0]) << 56) | \
((uint64_t)(((const u_char *)(p))[1]) << 48) | \
((uint64_t)(((const u_char *)(p))[2]) << 40) | \
((uint64_t)(((const u_char *)(p))[3]) << 32) | \
((uint64_t)(((const u_char *)(p))[4]) << 24) | \
((uint64_t)(((const u_char *)(p))[5]) << 16) | \
((uint64_t)(((const u_char *)(p))[6]) << 8) | \
(uint64_t)(((const u_char *)(p))[7]))
#define PEEK_U32(p) \
(((u_int32_t)(((const u_char *)(p))[0]) << 24) | \
((u_int32_t)(((const u_char *)(p))[1]) << 16) | \
((u_int32_t)(((const u_char *)(p))[2]) << 8) | \
(u_int32_t)(((const u_char *)(p))[3]))
(((uint32_t)(((const u_char *)(p))[0]) << 24) | \
((uint32_t)(((const u_char *)(p))[1]) << 16) | \
((uint32_t)(((const u_char *)(p))[2]) << 8) | \
(uint32_t)(((const u_char *)(p))[3]))
#define PEEK_U16(p) \
(((u_int16_t)(((const u_char *)(p))[0]) << 8) | \
(u_int16_t)(((const u_char *)(p))[1]))
(((uint16_t)(((const u_char *)(p))[0]) << 8) | \
(uint16_t)(((const u_char *)(p))[1]))
#define POKE_U64(p, v) \
do { \
const u_int64_t __v = (v); \
const uint64_t __v = (v); \
((u_char *)(p))[0] = (__v >> 56) & 0xff; \
((u_char *)(p))[1] = (__v >> 48) & 0xff; \
((u_char *)(p))[2] = (__v >> 40) & 0xff; \
@@ -368,7 +368,7 @@ int sshbuf_read(int, struct sshbuf *, size_t, size_t *)
} while (0)
#define POKE_U32(p, v) \
do { \
const u_int32_t __v = (v); \
const uint32_t __v = (v); \
((u_char *)(p))[0] = (__v >> 24) & 0xff; \
((u_char *)(p))[1] = (__v >> 16) & 0xff; \
((u_char *)(p))[2] = (__v >> 8) & 0xff; \
@@ -376,7 +376,7 @@ int sshbuf_read(int, struct sshbuf *, size_t, size_t *)
} while (0)
#define POKE_U16(p, v) \
do { \
const u_int16_t __v = (v); \
const uint16_t __v = (v); \
((u_char *)(p))[0] = (__v >> 8) & 0xff; \
((u_char *)(p))[1] = __v & 0xff; \
} while (0)
+26 -26
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: sshconnect2.c,v 1.383 2026/02/24 01:50:51 dtucker Exp $ */
/* $OpenBSD: sshconnect2.c,v 1.384 2026/03/03 09:57:25 dtucker Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Damien Miller. All rights reserved.
@@ -343,14 +343,14 @@ struct cauthmethod {
int *batch_flag; /* flag in option struct that disables method */
};
static int input_userauth_service_accept(int, u_int32_t, struct ssh *);
static int input_userauth_success(int, u_int32_t, struct ssh *);
static int input_userauth_failure(int, u_int32_t, struct ssh *);
static int input_userauth_banner(int, u_int32_t, struct ssh *);
static int input_userauth_error(int, u_int32_t, struct ssh *);
static int input_userauth_info_req(int, u_int32_t, struct ssh *);
static int input_userauth_pk_ok(int, u_int32_t, struct ssh *);
static int input_userauth_passwd_changereq(int, u_int32_t, struct ssh *);
static int input_userauth_service_accept(int, uint32_t, struct ssh *);
static int input_userauth_success(int, uint32_t, struct ssh *);
static int input_userauth_failure(int, uint32_t, struct ssh *);
static int input_userauth_banner(int, uint32_t, struct ssh *);
static int input_userauth_error(int, uint32_t, struct ssh *);
static int input_userauth_info_req(int, uint32_t, struct ssh *);
static int input_userauth_pk_ok(int, uint32_t, struct ssh *);
static int input_userauth_passwd_changereq(int, uint32_t, struct ssh *);
static int userauth_none(struct ssh *);
static int userauth_pubkey(struct ssh *);
@@ -361,10 +361,10 @@ static int userauth_hostbased(struct ssh *);
#ifdef GSSAPI
static int userauth_gssapi(struct ssh *);
static void userauth_gssapi_cleanup(struct ssh *);
static int input_gssapi_response(int type, u_int32_t, struct ssh *);
static int input_gssapi_token(int type, u_int32_t, struct ssh *);
static int input_gssapi_error(int, u_int32_t, struct ssh *);
static int input_gssapi_errtok(int, u_int32_t, struct ssh *);
static int input_gssapi_response(int type, uint32_t, struct ssh *);
static int input_gssapi_token(int type, uint32_t, struct ssh *);
static int input_gssapi_error(int, uint32_t, struct ssh *);
static int input_gssapi_errtok(int, uint32_t, struct ssh *);
#endif
void userauth(struct ssh *, char *);
@@ -484,7 +484,7 @@ ssh_userauth2(struct ssh *ssh, const char *local_user,
}
static int
input_userauth_service_accept(int type, u_int32_t seq, struct ssh *ssh)
input_userauth_service_accept(int type, uint32_t seq, struct ssh *ssh)
{
int r;
@@ -555,14 +555,14 @@ userauth(struct ssh *ssh, char *authlist)
}
static int
input_userauth_error(int type, u_int32_t seq, struct ssh *ssh)
input_userauth_error(int type, uint32_t seq, struct ssh *ssh)
{
fatal_f("bad message during authentication: type %d", type);
return 0;
}
static int
input_userauth_banner(int type, u_int32_t seq, struct ssh *ssh)
input_userauth_banner(int type, uint32_t seq, struct ssh *ssh)
{
char *msg = NULL;
size_t len;
@@ -581,7 +581,7 @@ input_userauth_banner(int type, u_int32_t seq, struct ssh *ssh)
}
static int
input_userauth_success(int type, u_int32_t seq, struct ssh *ssh)
input_userauth_success(int type, uint32_t seq, struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
@@ -600,7 +600,7 @@ input_userauth_success(int type, u_int32_t seq, struct ssh *ssh)
#if 0
static int
input_userauth_success_unexpected(int type, u_int32_t seq, struct ssh *ssh)
input_userauth_success_unexpected(int type, uint32_t seq, struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
@@ -614,7 +614,7 @@ input_userauth_success_unexpected(int type, u_int32_t seq, struct ssh *ssh)
#endif
static int
input_userauth_failure(int type, u_int32_t seq, struct ssh *ssh)
input_userauth_failure(int type, uint32_t seq, struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
char *authlist = NULL;
@@ -674,7 +674,7 @@ format_identity(Identity *id)
}
static int
input_userauth_pk_ok(int type, u_int32_t seq, struct ssh *ssh)
input_userauth_pk_ok(int type, uint32_t seq, struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
struct sshkey *key = NULL;
@@ -881,7 +881,7 @@ process_gssapi_token(struct ssh *ssh, gss_buffer_t recv_tok)
}
static int
input_gssapi_response(int type, u_int32_t plen, struct ssh *ssh)
input_gssapi_response(int type, uint32_t plen, struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
Gssctxt *gssctxt;
@@ -925,7 +925,7 @@ input_gssapi_response(int type, u_int32_t plen, struct ssh *ssh)
}
static int
input_gssapi_token(int type, u_int32_t plen, struct ssh *ssh)
input_gssapi_token(int type, uint32_t plen, struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
gss_buffer_desc recv_tok;
@@ -957,7 +957,7 @@ input_gssapi_token(int type, u_int32_t plen, struct ssh *ssh)
}
static int
input_gssapi_errtok(int type, u_int32_t plen, struct ssh *ssh)
input_gssapi_errtok(int type, uint32_t plen, struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
Gssctxt *gssctxt;
@@ -991,7 +991,7 @@ input_gssapi_errtok(int type, u_int32_t plen, struct ssh *ssh)
}
static int
input_gssapi_error(int type, u_int32_t plen, struct ssh *ssh)
input_gssapi_error(int type, uint32_t plen, struct ssh *ssh)
{
char *msg = NULL;
char *lang = NULL;
@@ -1068,7 +1068,7 @@ userauth_passwd(struct ssh *ssh)
* parse PASSWD_CHANGEREQ, prompt user and send SSH2_MSG_USERAUTH_REQUEST
*/
static int
input_userauth_passwd_changereq(int type, u_int32_t seqnr, struct ssh *ssh)
input_userauth_passwd_changereq(int type, uint32_t seqnr, struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
char *info = NULL, *lang = NULL, *password = NULL, *retype = NULL;
@@ -1938,7 +1938,7 @@ userauth_kbdint(struct ssh *ssh)
* parse INFO_REQUEST, prompt user and send INFO_RESPONSE
*/
static int
input_userauth_info_req(int type, u_int32_t seq, struct ssh *ssh)
input_userauth_info_req(int type, uint32_t seq, struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
char *name = NULL, *inst = NULL, *lang = NULL, *prompt = NULL;
+2 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: sshd-session.c,v 1.21 2026/03/02 02:40:15 djm Exp $ */
/* $OpenBSD: sshd-session.c,v 1.22 2026/03/03 09:57:26 dtucker Exp $ */
/*
* SSH2 implementation:
* Privilege Separation:
@@ -790,7 +790,7 @@ main(int ac, char **av)
const char *remote_ip, *rdomain;
char *line, *laddr, *logfile = NULL;
u_int i;
u_int64_t ibytes, obytes;
uint64_t ibytes, obytes;
mode_t new_umask;
Authctxt *authctxt;
struct connection_info *connection_info = NULL;
+3 -3
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: sshkey.h,v 1.72 2026/02/06 22:59:18 dtucker Exp $ */
/* $OpenBSD: sshkey.h,v 1.73 2026/03/03 09:57:26 dtucker Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
@@ -102,11 +102,11 @@ enum sshkey_private_format {
struct sshkey_cert {
struct sshbuf *certblob; /* Kept around for use on wire */
u_int type; /* SSH2_CERT_TYPE_USER or SSH2_CERT_TYPE_HOST */
u_int64_t serial;
uint64_t serial;
char *key_id;
u_int nprincipals;
char **principals;
u_int64_t valid_after, valid_before;
uint64_t valid_after, valid_before;
struct sshbuf *critical;
struct sshbuf *extensions;
struct sshkey *signature_key;
+5 -5
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: umac.c,v 1.29 2026/02/14 00:18:34 jsg Exp $ */
/* $OpenBSD: umac.c,v 1.30 2026/03/03 09:57:26 dtucker Exp $ */
/* -----------------------------------------------------------------------
*
* umac.c -- C Implementation UMAC Message Authentication
@@ -90,10 +90,10 @@
/* ---------------------------------------------------------------------- */
/* The following assumptions may need change on your system */
typedef u_int8_t UINT8; /* 1 byte */
typedef u_int16_t UINT16; /* 2 byte */
typedef u_int32_t UINT32; /* 4 byte */
typedef u_int64_t UINT64; /* 8 bytes */
typedef uint8_t UINT8; /* 1 byte */
typedef uint16_t UINT16; /* 2 byte */
typedef uint32_t UINT32; /* 4 byte */
typedef uint64_t UINT64; /* 8 bytes */
typedef unsigned int UWORD; /* Register */
/* ---------------------------------------------------------------------- */