/openssh-portable/ |
H A D | sshbuf-getput-basic.c | 190 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 362 int r, len; in sshbuf_putfv() local 550 size_t len; in sshbuf_froms() local 582 for (; len > 0 && *s == 0; len--, s++) in sshbuf_put_bignum2_bytes() 609 len = olen; in sshbuf_get_bignum2_bytes_direct() [all …]
|
H A D | sshbuf-getput-crypto.c | 40 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 D | sshbuf.c | 297 if (len > buf->max_size || buf->max_size - len < buf->size - buf->off) in sshbuf_check_reserve() 318 if (len + buf->size <= buf->alloc) in sshbuf_allocate() 359 buf->size += len; in sshbuf_reserve() 370 SSHBUF_DBG(("len = %zu", len)); in sshbuf_consume() 373 if (len == 0) in sshbuf_consume() 375 if (len > sshbuf_len(buf)) in sshbuf_consume() 377 buf->off += len; in sshbuf_consume() 390 SSHBUF_DBG(("len = %zu", len)); in sshbuf_consume_end() 393 if (len == 0) in sshbuf_consume_end() 395 if (len > sshbuf_len(buf)) in sshbuf_consume_end() [all …]
|
H A D | entropy.c | 79 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 D | sshbuf-misc.c | 44 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() 238 const void *s, size_t len) in sshbuf_cmp() argument 242 if (offset > SSHBUF_SIZE_MAX || len > SSHBUF_SIZE_MAX || len == 0) in sshbuf_cmp() 244 if (offset + len > sshbuf_len(b)) in sshbuf_cmp() [all …]
|
H A D | ssh-rsa.c | 170 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 D | bitmap.c | 48 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 D | ssh-xmss.c | 80 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() 121 size_t len, required_siglen; in ssh_xmss_verify() local 149 if (len != required_siglen) { in ssh_xmss_verify() 153 if (datalen >= SIZE_MAX - len) { in ssh_xmss_verify() 157 smlen = len + datalen; in ssh_xmss_verify() 163 memcpy(sm, sigblob, len); in ssh_xmss_verify() [all …]
|
H A D | ssh-ed25519.c | 40 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() 101 size_t len; in ssh_ed25519_verify() local 125 if (len > crypto_sign_ed25519_BYTES) { in ssh_ed25519_verify() 129 if (datalen >= SIZE_MAX - len) { in ssh_ed25519_verify() 133 smlen = len + datalen; in ssh_ed25519_verify() 139 memcpy(sm, sigblob, len); in ssh_ed25519_verify() [all …]
|
H A D | cipher-aes.c | 72 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 D | ssh_api.h | 104 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 D | cipher.c | 355 memcpy(dest, src, aadlen + len); in cipher_crypt() 363 dest + aadlen, len); in cipher_crypt() 389 if (len % cc->cipher->block_size) in cipher_crypt() 392 len) < 0) in cipher_crypt() 411 const u_char *cp, u_int len) in cipher_get_length() argument 415 cp, len); in cipher_get_length() 416 if (len < 4) in cipher_get_length() 469 if (len != 0) in cipher_get_keyiv() 488 if ((size_t)evplen != len) in cipher_get_keyiv() 497 len, iv)) in cipher_get_keyiv() [all …]
|
H A D | cipher-ctr.c | 49 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 D | cipher-chachapoly.c | 71 const u_char *src, u_int len, u_int aadlen, u_int authlen, int do_encrypt) in chachapoly_crypt() argument 90 const u_char *tag = src + aadlen + len; in chachapoly_crypt() 92 poly1305_auth(expected_tag, src, aadlen + len, poly_key); in chachapoly_crypt() 108 dest + aadlen, len); in chachapoly_crypt() 112 poly1305_auth(dest + aadlen + len, dest, aadlen + len, in chachapoly_crypt() 126 u_int *plenp, u_int seqnr, const u_char *cp, u_int len) in chachapoly_get_length() argument 130 if (len < 4) in chachapoly_get_length()
|
H A D | auth2-gss.c | 71 size_t len; in userauth_gssapi() local 91 if (len > 2 && doid[0] == SSH_GSS_OIDTYPE && in userauth_gssapi() 92 doid[1] == len - 2) { in userauth_gssapi() 94 goid.length = len - 2; in userauth_gssapi() 147 size_t len; in input_gssapi_token() local 159 recv_tok.length = len; in input_gssapi_token() 212 size_t len; in input_gssapi_errtok() local 222 recv_tok.length = len; in input_gssapi_errtok() 289 size_t len; in input_gssapi_mic() local 296 if ((r = sshpkt_get_string(ssh, &p, &len)) != 0) in input_gssapi_mic() [all …]
|
H A D | utf8.c | 139 if ((len = mbtowc(&wc, sp, MB_CUR_MAX)) == -1) { in vasnmprintf() 145 len = 1; in vasnmprintf() 164 if (print && (dp - dst >= (int)maxsz - len || in vasnmprintf() 169 &dp, len) == -1) { in vasnmprintf() 174 memcpy(dp, sp, len); in vasnmprintf() 175 dp += len; in vasnmprintf() 177 sp += len; in vasnmprintf() 179 ret += len; in vasnmprintf() 185 while (len > 0) { in vasnmprintf() 201 len--; in vasnmprintf() [all …]
|
H A D | cipher-chachapoly-libcrypto.c | 87 const u_char *src, u_int len, u_int aadlen, u_int authlen, int do_encrypt) in chachapoly_crypt() argument 109 const u_char *tag = src + aadlen + len; in chachapoly_crypt() 111 poly1305_auth(expected_tag, src, aadlen + len, poly_key); in chachapoly_crypt() 130 EVP_Cipher(ctx->main_evp, dest + aadlen, src + aadlen, len) < 0) { in chachapoly_crypt() 137 poly1305_auth(dest + aadlen + len, dest, aadlen + len, in chachapoly_crypt() 151 u_int *plenp, u_int seqnr, const u_char *cp, u_int len) in chachapoly_get_length() argument 155 if (len < 4) in chachapoly_get_length()
|
/openssh-portable/openbsd-compat/ |
H A D | strptime.c | 71 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 D | inet_ntop.c | 119 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 D | setproctitle.c | 129 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 D | bsd-cygwin_util.c | 194 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 D | strndup.c | 31 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 D | dirname.c | 32 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 D | basename.c | 30 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 D | tests.c | 24 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()
|