Home
last modified time | relevance | path

Searched refs:len (Results 1 – 25 of 126) sorted by relevance

123456

/openssh-portable/
H A Dsshbuf-getput-basic.c190 size_t len; in sshbuf_get_string() local
209 *lenp = len; in sshbuf_get_string()
216 size_t len; in sshbuf_get_string_direct() local
229 *lenp = len; in sshbuf_get_string_direct()
266 *lenp = len; in sshbuf_peek_string_direct()
273 size_t len; in sshbuf_get_cstring() local
360 int r, len; in sshbuf_putfv() local
545 size_t len; in sshbuf_froms() local
577 for (; len > 0 && *s == 0; len--, s++) in sshbuf_put_bignum2_bytes()
604 len = olen; in sshbuf_get_bignum2_bytes_direct()
[all …]
H A Dsshbuf-getput-crypto.c40 size_t len; in sshbuf_get_bignum2() local
49 BN_bin2bn(d, len, v) == NULL) { in sshbuf_get_bignum2()
63 if (len == 0 || len > SSHBUF_MAX_ECPOINT) in get_ec()
77 size_t len; in sshbuf_get_ec() local
100 size_t len; in sshbuf_get_eckey() local
136 if (len < 0 || len > SSHBUF_MAX_BIGNUM) in sshbuf_put_bignum2()
139 if (BN_bn2bin(v, d + 1) != len) in sshbuf_put_bignum2()
142 if (len > 0 && (d[1] & 0x80) != 0) in sshbuf_put_bignum2()
157 size_t len; in sshbuf_put_ec() local
165 d, len, NULL) != len) { in sshbuf_put_ec()
[all …]
H A Dsshbuf.c298 if (len > buf->max_size || buf->max_size - len < buf->size - buf->off) in sshbuf_check_reserve()
319 if (len + buf->size <= buf->alloc) in sshbuf_allocate()
360 buf->size += len; in sshbuf_reserve()
371 SSHBUF_DBG(("len = %zu", len)); in sshbuf_consume()
374 if (len == 0) in sshbuf_consume()
376 if (len > sshbuf_len(buf)) in sshbuf_consume()
378 buf->off += len; in sshbuf_consume()
391 SSHBUF_DBG(("len = %zu", len)); in sshbuf_consume_end()
394 if (len == 0) in sshbuf_consume_end()
396 if (len > sshbuf_len(buf)) in sshbuf_consume_end()
[all …]
H A Dsshbuf-misc.c44 for (i = 0; i < len; i += 16) { in sshbuf_dump_data()
47 if (j < len) in sshbuf_dump_data()
54 if (j < len) { in sshbuf_dump_data()
75 size_t i, j, len = sshbuf_len(buf); in sshbuf_dtob16() local
80 if (len == 0) in sshbuf_dtob16()
82 if (SIZE_MAX / 2 <= len || (ret = malloc(len * 2 + 1)) == NULL) in sshbuf_dtob16()
84 for (i = j = 0; i < len; i++) { in sshbuf_dtob16()
198 const void *s, size_t len) in sshbuf_cmp() argument
202 if (offset > SSHBUF_SIZE_MAX || len > SSHBUF_SIZE_MAX || len == 0) in sshbuf_cmp()
204 if (offset + len > sshbuf_len(b)) in sshbuf_cmp()
[all …]
H A Dentropy.c79 get_random_bytes_prngd(unsigned char *buf, int len, in get_random_bytes_prngd() argument
95 if (len <= 0 || len > 255) in get_random_bytes_prngd()
96 fatal("Too many bytes (%d) to read from PRNGD", len); in get_random_bytes_prngd()
137 msg[1] = len; in get_random_bytes_prngd()
150 if (atomicio(read, fd, buf, len) != (size_t)len) { in get_random_bytes_prngd()
189 size_t len = sizeof(buf); in rexec_send_rng_seed() local
195 len = 0; in rexec_send_rng_seed()
197 if ((r = sshbuf_put_string(m, buf, len)) != 0) in rexec_send_rng_seed()
206 size_t len = 0; in rexec_recv_rng_seed() local
213 (unsigned long)len); in rexec_recv_rng_seed()
[all …]
H A Dssh-rsa.c170 u_int dlen, len; in ssh_rsa_sign() local
210 if (len < slen) { in ssh_rsa_sign()
211 size_t diff = slen - len; in ssh_rsa_sign()
214 } else if (len > slen) { in ssh_rsa_sign()
226 len = sshbuf_len(b); in ssh_rsa_sign()
235 *lenp = len; in ssh_rsa_sign()
298 if (len > modlen) { in ssh_rsa_verify()
302 diff = modlen - len; in ssh_rsa_verify()
311 len = modlen; in ssh_rsa_verify()
324 freezero(sigblob, len); in ssh_rsa_verify()
[all …]
H A Dbitmap.c48 ret->len = 1; in bitmap_new()
67 memset(b->d, 0, b->len * BITMAP_BYTES); in bitmap_zero()
74 if (b->top >= b->len) in bitmap_test_bit()
87 if (b->top >= b->len || n > BITMAP_MAX) in reserve()
90 if (b->len < nlen) { in reserve()
91 if ((tmp = recallocarray(b->d, b->len, in reserve()
95 b->len = nlen; in reserve()
119 if (b->top >= b->len) in retop()
130 if (b->top >= b->len || n > BITMAP_MAX) in bitmap_clear_bit()
147 if (b->top >= b->len) in bitmap_nbits()
[all …]
H A Dssh-ed25519.c40 size_t slen = 0, len; in ssh_ed25519_sign() local
72 len = sshbuf_len(b); in ssh_ed25519_sign()
74 if ((*sigp = malloc(len)) == NULL) { in ssh_ed25519_sign()
78 memcpy(*sigp, sshbuf_ptr(b), len); in ssh_ed25519_sign()
81 *lenp = len; in ssh_ed25519_sign()
103 size_t len; in ssh_ed25519_verify() local
127 if (len > crypto_sign_ed25519_BYTES) { in ssh_ed25519_verify()
131 if (datalen >= SIZE_MAX - len) { in ssh_ed25519_verify()
135 smlen = len + datalen; in ssh_ed25519_verify()
141 memcpy(sm, sigblob, len); in ssh_ed25519_verify()
[all …]
H A Dssh-xmss.c80 len = sshbuf_len(b); in ssh_xmss_sign()
82 if ((*sigp = malloc(len)) == NULL) { in ssh_xmss_sign()
86 memcpy(*sigp, sshbuf_ptr(b), len); in ssh_xmss_sign()
89 *lenp = len; in ssh_xmss_sign()
96 explicit_bzero(*sigp, len); in ssh_xmss_sign()
123 size_t len, required_siglen; in ssh_xmss_verify() local
151 if (len != required_siglen) { in ssh_xmss_verify()
155 if (datalen >= SIZE_MAX - len) { in ssh_xmss_verify()
159 smlen = len + datalen; in ssh_xmss_verify()
165 memcpy(sm, sigblob, len); in ssh_xmss_verify()
[all …]
H A Dcipher-aes.c72 LIBCRYPTO_EVP_INL_TYPE len) in ssh_rijndael_cbc() argument
77 int i, j, blocks = len / RIJNDAEL_BLOCKSIZE; in ssh_rijndael_cbc()
79 if (len == 0) in ssh_rijndael_cbc()
81 if (len % RIJNDAEL_BLOCKSIZE) in ssh_rijndael_cbc()
82 fatal("ssh_rijndael_cbc: bad len %d", len); in ssh_rijndael_cbc()
100 cnow = (u_char *) (src+len-RIJNDAEL_BLOCKSIZE); in ssh_rijndael_cbc()
101 plain = dest+len-RIJNDAEL_BLOCKSIZE; in ssh_rijndael_cbc()
130 ssh_rijndael_iv(EVP_CIPHER_CTX *evp, int doset, u_char * iv, u_int len) in ssh_rijndael_iv() argument
137 memcpy(c->r_iv, iv, len); in ssh_rijndael_iv()
139 memcpy(iv, c->r_iv, len); in ssh_rijndael_iv()
H A Dcipher-chachapoly.c53 const u_char *src, u_int len, u_int aadlen, u_int authlen, int do_encrypt) in chachapoly_crypt() argument
72 const u_char *tag = src + aadlen + len; in chachapoly_crypt()
74 poly1305_auth(expected_tag, src, aadlen + len, poly_key); in chachapoly_crypt()
90 dest + aadlen, len); in chachapoly_crypt()
94 poly1305_auth(dest + aadlen + len, dest, aadlen + len, in chachapoly_crypt()
108 u_int *plenp, u_int seqnr, const u_char *cp, u_int len) in chachapoly_get_length() argument
112 if (len < 4) in chachapoly_get_length()
H A Dssh_api.h104 size_t len);
110 int ssh_input_space(struct ssh *ssh, size_t len);
115 int ssh_input_append(struct ssh *ssh, const u_char *data, size_t len);
121 int ssh_output_space(struct ssh *ssh, size_t len);
129 const u_char *ssh_output_ptr(struct ssh *ssh, size_t *len);
135 int ssh_output_consume(struct ssh *ssh, size_t len);
H A Dcipher-ctr.c49 ssh_ctr_inc(u_char *ctr, size_t len) in ssh_ctr_inc() argument
53 for (i = len - 1; i >= 0; i--) in ssh_ctr_inc()
60 LIBCRYPTO_EVP_INL_TYPE len) in ssh_aes_ctr() argument
66 if (len == 0) in ssh_aes_ctr()
71 while ((len--) > 0) { in ssh_aes_ctr()
114 ssh_aes_ctr_iv(EVP_CIPHER_CTX *evp, int doset, u_char * iv, size_t len) in ssh_aes_ctr_iv() argument
121 memcpy(c->aes_counter, iv, len); in ssh_aes_ctr_iv()
123 memcpy(iv, c->aes_counter, len); in ssh_aes_ctr_iv()
H A Dcipher.c346 memcpy(dest, src, aadlen + len); in cipher_crypt()
354 dest + aadlen, len); in cipher_crypt()
380 if (len % cc->cipher->block_size) in cipher_crypt()
383 len) < 0) in cipher_crypt()
402 const u_char *cp, u_int len) in cipher_get_length() argument
406 cp, len); in cipher_get_length()
407 if (len < 4) in cipher_get_length()
460 if (len != 0) in cipher_get_keyiv()
479 if ((size_t)evplen != len) in cipher_get_keyiv()
488 len, iv)) in cipher_get_keyiv()
[all …]
H A Dutf8.c140 if ((len = mbtowc(&wc, sp, MB_CUR_MAX)) == -1) { in vasnmprintf()
146 len = 1; in vasnmprintf()
165 if (print && (dp - dst >= (int)maxsz - len || in vasnmprintf()
170 &dp, len) == -1) { in vasnmprintf()
175 memcpy(dp, sp, len); in vasnmprintf()
176 dp += len; in vasnmprintf()
178 sp += len; in vasnmprintf()
180 ret += len; in vasnmprintf()
186 while (len > 0) { in vasnmprintf()
202 len--; in vasnmprintf()
[all …]
H A Dauth2-gss.c70 size_t len; in userauth_gssapi() local
90 if (len > 2 && doid[0] == SSH_GSS_OIDTYPE && in userauth_gssapi()
91 doid[1] == len - 2) { in userauth_gssapi()
93 goid.length = len - 2; in userauth_gssapi()
146 size_t len; in input_gssapi_token() local
158 recv_tok.length = len; in input_gssapi_token()
211 size_t len; in input_gssapi_errtok() local
221 recv_tok.length = len; in input_gssapi_errtok()
288 size_t len; in input_gssapi_mic() local
295 if ((r = sshpkt_get_string(ssh, &p, &len)) != 0) in input_gssapi_mic()
[all …]
H A Dsshbuf.h63 struct sshbuf *sshbuf_from(const void *blob, size_t len);
130 int sshbuf_check_reserve(const struct sshbuf *buf, size_t len);
138 int sshbuf_allocate(struct sshbuf *buf, size_t len);
145 int sshbuf_reserve(struct sshbuf *buf, size_t len, u_char **dpp);
151 int sshbuf_consume(struct sshbuf *buf, size_t len);
157 int sshbuf_consume_end(struct sshbuf *buf, size_t len);
160 int sshbuf_get(struct sshbuf *buf, void *v, size_t len);
161 int sshbuf_put(struct sshbuf *buf, const void *v, size_t len);
248 void sshbuf_dump_data(const void *s, size_t len, FILE *f);
273 const void *s, size_t len);
[all …]
/openssh-portable/openbsd-compat/
H A Dstrptime.c71 size_t len; in _strptime() local
175 len = strlen(_ctloc(day[i])); in _strptime()
180 len = strlen(_ctloc(abday[i])); in _strptime()
190 bp += len; in _strptime()
199 len = strlen(_ctloc(mon[i])); in _strptime()
204 len = strlen(_ctloc(abmon[i])); in _strptime()
214 bp += len; in _strptime()
275 len = strlen(_ctloc(am_pm[0])); in _strptime()
282 bp += len; in _strptime()
286 len = strlen(_ctloc(am_pm[1])); in _strptime()
[all …]
H A Dinet_ntop.c119 struct { int base, len; } best, cur; in inet_ntop6() member
137 cur.base = i, cur.len = 1; in inet_ntop6()
139 cur.len++; in inet_ntop6()
142 if (best.base == -1 || cur.len > best.len) in inet_ntop6()
149 if (best.base == -1 || cur.len > best.len) in inet_ntop6()
152 if (best.base != -1 && best.len < 2) in inet_ntop6()
163 i < (best.base + best.len)) { in inet_ntop6()
179 (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) { in inet_ntop6()
191 if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) { in inet_ntop6()
H A Dsetproctitle.c129 size_t len = 0; in setproctitle() local
146 len = strlcat(buf, ": ", sizeof(buf)); in setproctitle()
147 if (len < sizeof(buf)) in setproctitle()
148 r = vsnprintf(buf + len, sizeof(buf) - len , fmt, ap); in setproctitle()
151 if (r == -1 || (size_t)r >= sizeof(buf) - len) in setproctitle()
162 len = strlcpy(argv_start, ptitle, argv_env_len); in setproctitle()
163 for(; len < argv_env_len; len++) in setproctitle()
164 argv_start[len] = SPT_PADCHAR; in setproctitle()
H A Dbsd-cygwin_util.c194 size_t len; in _match_pattern() local
197 if ((len = mbstowcs(NULL, s, 0)) < 0) in _match_pattern()
199 ws = (wchar_t *) xcalloc(len + 1, sizeof (wchar_t)); in _match_pattern()
200 mbstowcs(ws, s, len + 1); in _match_pattern()
201 if ((len = mbstowcs(NULL, pattern, 0)) < 0) in _match_pattern()
203 wpattern = (wchar_t *) xcalloc(len + 1, sizeof (wchar_t)); in _match_pattern()
204 mbstowcs(wpattern, pattern, len + 1); in _match_pattern()
223 u_int i, subi, len = strlen(pattern); in cygwin_ug_match_pattern_list() local
226 for (i = 0; i < len;) { in cygwin_ug_match_pattern_list()
239 i < len && subi < sizeof(sub) - 1 && pattern[i] != ','; in cygwin_ug_match_pattern_list()
[all …]
H A Dstrndup.c31 size_t len; in strndup() local
33 len = strnlen(str, maxlen); in strndup()
34 copy = malloc(len + 1); in strndup()
36 (void)memcpy(copy, str, len); in strndup()
37 copy[len] = '\0'; in strndup()
H A Ddirname.c32 size_t len; in dirname() local
63 len = endp - path + 1; in dirname()
64 if (len >= sizeof(dname)) { in dirname()
68 memcpy(dname, path, len); in dirname()
69 dname[len] = '\0'; in dirname()
H A Dbasename.c30 size_t len; in basename() local
57 len = endp - startp + 1; in basename()
58 if (len >= sizeof(bname)) { in basename()
62 memcpy(bname, startp, len); in basename()
63 bname[len] = '\0'; in basename()
/openssh-portable/regress/unittests/utf8/
H A Dtests.c24 int len, width; in badarg() local
28 len = snmprintf(buf, sizeof(buf), &width, "\377"); in badarg()
29 ASSERT_INT_EQ(len, -1); in badarg()
41 int len; in one() local
49 len = snmprintf(buf, sizeof(buf), wp, "%s", mbs); in one()
50 ASSERT_INT_EQ(len, wantlen); in one()

Completed in 46 milliseconds

123456