-/* $Id: aldap.c,v 1.4 2018/07/31 11:37:18 rob Exp $ */
-/* $OpenBSD: aldap.c,v 1.4 2018/07/31 11:37:18 rob Exp $ */
+/* $Id: aldap.c,v 1.5 2018/08/12 22:04:09 rob Exp $ */
+/* $OpenBSD: aldap.c,v 1.5 2018/08/12 22:04:09 rob Exp $ */
/*
* Copyright (c) 2008 Alexander Schrijver <aschrijver@openbsd.org>
int
aldap_send(struct aldap *ldap, struct ber_element *root)
{
- int error, wrote;
void *ptr;
char *data;
size_t len, done;
+ ssize_t error, wrote;
len = ber_calc_len(root);
error = ber_write_elements(&ldap->ber, root);
aldap_create_page_control(struct ber_element *elm, int size,
struct aldap_page_control *page)
{
- int len;
+ ssize_t len;
struct ber c;
struct ber_element *ber = NULL;
-/* $OpenBSD: ber.c,v 1.18 2018/08/03 01:51:28 rob Exp $ */
+/* $OpenBSD: ber.c,v 1.19 2018/08/12 22:04:09 rob Exp $ */
/*
* Copyright (c) 2007, 2012 Reyk Floeter <reyk@openbsd.org>
* >=0 number of bytes written
* -1 on failure and sets errno
*/
-int
+ssize_t
ber_write_elements(struct ber *ber, struct ber_element *root)
{
size_t len;
-/* $OpenBSD: ber.h,v 1.6 2018/08/03 01:51:28 rob Exp $ */
+/* $OpenBSD: ber.h,v 1.7 2018/08/12 22:04:09 rob Exp $ */
/*
* Copyright (c) 2007, 2012 Reyk Floeter <reyk@openbsd.org>
struct ber_element *ber_printf_elements(struct ber_element *, char *, ...);
int ber_scanf_elements(struct ber_element *, char *, ...);
ssize_t ber_get_writebuf(struct ber *, void **);
-int ber_write_elements(struct ber *, struct ber_element *);
+ssize_t ber_write_elements(struct ber *, struct ber_element *);
void ber_set_readbuf(struct ber *, void *, size_t);
struct ber_element *ber_read_elements(struct ber *, struct ber_element *);
off_t ber_getpos(struct ber_element *);
-/* $OpenBSD: ber.c,v 1.28 2018/08/03 01:51:28 rob Exp $ */
+/* $OpenBSD: ber.c,v 1.29 2018/08/12 22:04:09 rob Exp $ */
/*
* Copyright (c) 2007, 2012 Reyk Floeter <reyk@openbsd.org>
* >=0 number of bytes written
* -1 on failure and sets errno
*/
-int
+ssize_t
ber_write_elements(struct ber *ber, struct ber_element *root)
{
size_t len;
-/* $OpenBSD: ber.h,v 1.7 2018/08/03 01:51:28 rob Exp $ */
+/* $OpenBSD: ber.h,v 1.8 2018/08/12 22:04:09 rob Exp $ */
/*
* Copyright (c) 2007, 2012 Reyk Floeter <reyk@openbsd.org>
struct ber_element *ber_printf_elements(struct ber_element *, char *, ...);
int ber_scanf_elements(struct ber_element *, char *, ...);
ssize_t ber_get_writebuf(struct ber *, void **);
-int ber_write_elements(struct ber *, struct ber_element *);
+ssize_t ber_write_elements(struct ber *, struct ber_element *);
void ber_set_readbuf(struct ber *, void *, size_t);
struct ber_element *ber_read_elements(struct ber *, struct ber_element *);
off_t ber_getpos(struct ber_element *);
-/* $OpenBSD: ldape.c,v 1.29 2018/07/31 11:01:00 claudio Exp $ */
+/* $OpenBSD: ldape.c,v 1.30 2018/08/12 22:04:09 rob Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
send_ldap_extended_response(struct conn *conn, int msgid, unsigned int type,
long long result_code, const char *extended_oid)
{
- int rc;
+ ssize_t rc;
struct ber_element *root, *elm;
void *buf;
struct referral *ref;
long long result_code = LDAP_REFERRAL;
unsigned int type;
- int rc;
+ ssize_t rc;
void *buf;
char *url, *scope_str = NULL;
-.\" $OpenBSD: ber.3,v 1.17 2018/07/31 11:01:29 claudio Exp $
+.\" $OpenBSD: ber.3,v 1.18 2018/08/12 22:04:09 rob Exp $
.\"
.\" Copyright (c) 2007, 2012 Reyk Floeter <reyk@openbsd.org>
.\"
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: July 31 2018 $
+.Dd $Mdocdate: August 12 2018 $
.Dt BER 3
.Os
.Sh NAME
.Fn "ber_scanf_elements" "struct ber_element *root" "char *format" "..."
.Ft "ssize_t"
.Fn "ber_get_writebuf" "struct ber *ber" "void **buf"
-.Ft "int"
+.Ft "ssize_t"
.Fn "ber_write_elements" "struct ber *ber" "struct ber_element *root"
.Ft "void"
.Fn "ber_set_readbuf" "struct ber *ber" "void *buf" "size_t len"
-/* $OpenBSD: ber.c,v 1.47 2018/08/03 01:51:28 rob Exp $ */
+/* $OpenBSD: ber.c,v 1.48 2018/08/12 22:04:09 rob Exp $ */
/*
* Copyright (c) 2007, 2012 Reyk Floeter <reyk@openbsd.org>
* >=0 number of bytes written
* -1 on failure and sets errno
*/
-int
+ssize_t
ber_write_elements(struct ber *ber, struct ber_element *root)
{
size_t len;
-/* $OpenBSD: ber.h,v 1.13 2018/08/03 01:51:28 rob Exp $ */
+/* $OpenBSD: ber.h,v 1.14 2018/08/12 22:04:09 rob Exp $ */
/*
* Copyright (c) 2007, 2012 Reyk Floeter <reyk@openbsd.org>
struct ber_element *ber_printf_elements(struct ber_element *, char *, ...);
int ber_scanf_elements(struct ber_element *, char *, ...);
ssize_t ber_get_writebuf(struct ber *, void **);
-int ber_write_elements(struct ber *, struct ber_element *);
+ssize_t ber_write_elements(struct ber *, struct ber_element *);
void ber_set_readbuf(struct ber *, void *, size_t);
struct ber_element *ber_read_elements(struct ber *, struct ber_element *);
off_t ber_getpos(struct ber_element *);
-/* $OpenBSD: usm.c,v 1.12 2018/02/08 18:02:06 jca Exp $ */
+/* $OpenBSD: usm.c,v 1.13 2018/08/12 22:04:09 rob Exp $ */
/*
* Copyright (c) 2012 GeNUA mbH
struct ber_element *usm, *a, *res = NULL;
void *ptr;
char digest[SNMP_USM_DIGESTLEN];
- size_t digestlen, saltlen, len;
+ size_t digestlen, saltlen;
+ ssize_t len;
msg->sm_digest_offs = 0;
bzero(&ber, sizeof(ber));
struct ber ber;
struct ber_element *encrpdu = NULL;
void *ptr;
- int len;
- ssize_t elen;
+ ssize_t elen, len;
u_char encbuf[READ_BUF_SIZE];
if (!MSG_HAS_PRIV(msg))
-/* $Id: aldap.c,v 1.42 2018/07/31 11:37:18 rob Exp $ */
-/* $OpenBSD: aldap.c,v 1.42 2018/07/31 11:37:18 rob Exp $ */
+/* $Id: aldap.c,v 1.43 2018/08/12 22:04:09 rob Exp $ */
+/* $OpenBSD: aldap.c,v 1.43 2018/08/12 22:04:09 rob Exp $ */
/*
* Copyright (c) 2008 Alexander Schrijver <aschrijver@openbsd.org>
int
aldap_send(struct aldap *ldap, struct ber_element *root)
{
- int error, wrote;
void *ptr;
char *data;
size_t len, done;
+ ssize_t error, wrote;
len = ber_calc_len(root);
error = ber_write_elements(&ldap->ber, root);
aldap_create_page_control(struct ber_element *elm, int size,
struct aldap_page_control *page)
{
- int len;
+ ssize_t len;
struct ber c;
struct ber_element *ber = NULL;
-/* $OpenBSD: ber.c,v 1.30 2018/08/03 01:51:28 rob Exp $ */
+/* $OpenBSD: ber.c,v 1.31 2018/08/12 22:04:09 rob Exp $ */
/*
* Copyright (c) 2007, 2012 Reyk Floeter <reyk@openbsd.org>
* >=0 number of bytes written
* -1 on failure and sets errno
*/
-int
+ssize_t
ber_write_elements(struct ber *ber, struct ber_element *root)
{
size_t len;
-/* $OpenBSD: ber.h,v 1.8 2018/08/03 01:51:28 rob Exp $ */
+/* $OpenBSD: ber.h,v 1.9 2018/08/12 22:04:09 rob Exp $ */
/*
* Copyright (c) 2007, 2012 Reyk Floeter <reyk@openbsd.org>
struct ber_element *ber_printf_elements(struct ber_element *, char *, ...);
int ber_scanf_elements(struct ber_element *, char *, ...);
ssize_t ber_get_writebuf(struct ber *, void **);
-int ber_write_elements(struct ber *, struct ber_element *);
+ssize_t ber_write_elements(struct ber *, struct ber_element *);
void ber_set_readbuf(struct ber *, void *, size_t);
struct ber_element *ber_read_elements(struct ber *, struct ber_element *);
off_t ber_getpos(struct ber_element *);