summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/sshbuf-misc.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2019-07-30 05:04:49 +0000
committerdjm <djm@openbsd.org>2019-07-30 05:04:49 +0000
commitd8ff1cfb1d7fe1c77115cf7b11408326795a344c (patch)
treec7a9141e48e8cf319c666eedc9cef6117f4067eb /usr.bin/ssh/sshbuf-misc.c
parentcorrect mispellings of EACCES; from Kris Katterjohn (diff)
downloadwireguard-openbsd-d8ff1cfb1d7fe1c77115cf7b11408326795a344c.tar.xz
wireguard-openbsd-d8ff1cfb1d7fe1c77115cf7b11408326795a344c.zip
let sshbuf_find/cmp take a void* for the search/comparison
argument, instead of a u_char*. Saves callers needing to cast.
Diffstat (limited to 'usr.bin/ssh/sshbuf-misc.c')
-rw-r--r--usr.bin/ssh/sshbuf-misc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/ssh/sshbuf-misc.c b/usr.bin/ssh/sshbuf-misc.c
index 89149e06d06..b30eaeaabb3 100644
--- a/usr.bin/ssh/sshbuf-misc.c
+++ b/usr.bin/ssh/sshbuf-misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshbuf-misc.c,v 1.10 2019/07/18 13:26:00 djm Exp $ */
+/* $OpenBSD: sshbuf-misc.c,v 1.11 2019/07/30 05:04:49 djm Exp $ */
/*
* Copyright (c) 2011 Damien Miller
*
@@ -191,7 +191,7 @@ sshbuf_dup_string(struct sshbuf *buf)
int
sshbuf_cmp(const struct sshbuf *b, size_t offset,
- const u_char *s, size_t len)
+ const void *s, size_t len)
{
if (sshbuf_ptr(b) == NULL)
return SSH_ERR_INTERNAL_ERROR;
@@ -206,13 +206,12 @@ sshbuf_cmp(const struct sshbuf *b, size_t offset,
int
sshbuf_find(const struct sshbuf *b, size_t start_offset,
- const u_char *s, size_t len, size_t *offsetp)
+ const void *s, size_t len, size_t *offsetp)
{
void *p;
if (offsetp != NULL)
*offsetp = 0;
-
if (sshbuf_ptr(b) == NULL)
return SSH_ERR_INTERNAL_ERROR;
if (start_offset > SSHBUF_SIZE_MAX || len > SSHBUF_SIZE_MAX || len == 0)