summaryrefslogtreecommitdiffstats
path: root/sshbuf.h
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2022-01-22 01:43:43 +0100
committerDamien Miller <djm@mindrot.org>2022-01-25 00:45:47 +0100
commit754e0d5c7712296a7a3a83ace863812604c7bc4f (patch)
treed0b0afc8303791db5f40a8d6d4b639ba45d68a83 /sshbuf.h
parentupstream: add a helper for writing an error message to the (diff)
downloadopenssh-754e0d5c7712296a7a3a83ace863812604c7bc4f.tar.xz
openssh-754e0d5c7712296a7a3a83ace863812604c7bc4f.zip
upstream: Add a sshbuf_read() that attempts to read(2) directly in
to a sshbuf; ok markus@ OpenBSD-Commit-ID: 2d8f249040a4279f3bc23c018947384de8d4a45b
Diffstat (limited to 'sshbuf.h')
-rw-r--r--sshbuf.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sshbuf.h b/sshbuf.h
index 75dac9b46..07d54f0a9 100644
--- a/sshbuf.h
+++ b/sshbuf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshbuf.h,v 1.24 2022/01/01 05:55:06 jsg Exp $ */
+/* $OpenBSD: sshbuf.h,v 1.25 2022/01/22 00:43:43 djm Exp $ */
/*
* Copyright (c) 2011 Damien Miller
*
@@ -309,6 +309,10 @@ int sshbuf_load_file(const char *, struct sshbuf **)
int sshbuf_write_file(const char *path, struct sshbuf *buf)
__attribute__((__nonnull__ (2)));
+/* Read up to maxlen bytes from a fd directly to a buffer */
+int sshbuf_read(int, struct sshbuf *, size_t, size_t *)
+ __attribute__((__nonnull__ (2)));
+
/* Macros for decoding/encoding integers */
#define PEEK_U64(p) \
(((u_int64_t)(((const u_char *)(p))[0]) << 56) | \