Lines Matching refs:len
89 sshbuf_from(const void *blob, size_t len)
93 if (blob == NULL || len > SSHBUF_SIZE_MAX ||
96 ret->alloc = ret->size = ret->max_size = len;
238 SSHBUF_DBG(("set max buf = %p len = %zu", buf, max_size));
303 sshbuf_check_reserve(const struct sshbuf *buf, size_t len)
312 /* Check that len is reasonable and that max_size + available < len */
313 if (len > buf->max_size || buf->max_size - len < buf->size - buf->off)
319 sshbuf_reserve(struct sshbuf *buf, size_t len, u_char **dpp)
328 SSHBUF_DBG(("reserve buf = %p len = %zu", buf, len));
329 if ((r = sshbuf_check_reserve(buf, len)) != 0)
335 sshbuf_maybe_pack(buf, buf->size + len > buf->max_size);
337 if (len + buf->size > buf->alloc) {
342 need = len + buf->size - buf->alloc;
356 if ((r = sshbuf_check_reserve(buf, len)) < 0) {
364 buf->size += len;
372 sshbuf_consume(struct sshbuf *buf, size_t len)
376 SSHBUF_DBG(("len = %zu", len));
379 if (len == 0)
381 if (len > sshbuf_len(buf))
383 buf->off += len;
389 sshbuf_consume_end(struct sshbuf *buf, size_t len)
393 SSHBUF_DBG(("len = %zu", len));
396 if (len == 0)
398 if (len > sshbuf_len(buf))
400 buf->size -= len;