summaryrefslogtreecommitdiff
path: root/sshbuf.h
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2020-02-21 11:57:14 +0000
committerColin Watson <cjwatson@debian.org>2020-02-21 14:27:02 +0000
commit886e47e745586c34e81cfd5c5fb9b5dbc8e84d04 (patch)
treedd6c3b4dc64a17c520af7aaf213163f8a0a63e56 /sshbuf.h
parentac2b4c0697fcac554041ab95f81736887eadf6ec (diff)
parenta2dabf35ce0228c86a288d11cc847a9d9801604f (diff)
New upstream release (8.2p1)
Diffstat (limited to 'sshbuf.h')
-rw-r--r--sshbuf.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/sshbuf.h b/sshbuf.h
index ebd64b10e..165cd0b18 100644
--- a/sshbuf.h
+++ b/sshbuf.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshbuf.h,v 1.18 2019/09/06 05:23:55 djm Exp $ */ 1/* $OpenBSD: sshbuf.h,v 1.19 2020/01/25 23:02:14 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2011 Damien Miller 3 * Copyright (c) 2011 Damien Miller
4 * 4 *
@@ -291,6 +291,22 @@ sshbuf_find(const struct sshbuf *b, size_t start_offset,
291 */ 291 */
292char *sshbuf_dup_string(struct sshbuf *buf); 292char *sshbuf_dup_string(struct sshbuf *buf);
293 293
294/*
295 * Fill a buffer from a file descriptor or filename. Both allocate the
296 * buffer for the caller.
297 */
298int sshbuf_load_fd(int, struct sshbuf **)
299 __attribute__((__nonnull__ (2)));
300int sshbuf_load_file(const char *, struct sshbuf **)
301 __attribute__((__nonnull__ (2)));
302
303/*
304 * Write a buffer to a path, creating/truncating as needed (mode 0644,
305 * subject to umask). The buffer contents are not modified.
306 */
307int sshbuf_write_file(const char *path, struct sshbuf *buf)
308 __attribute__((__nonnull__ (2)));
309
294/* Macros for decoding/encoding integers */ 310/* Macros for decoding/encoding integers */
295#define PEEK_U64(p) \ 311#define PEEK_U64(p) \
296 (((u_int64_t)(((const u_char *)(p))[0]) << 56) | \ 312 (((u_int64_t)(((const u_char *)(p))[0]) << 56) | \