Home
last modified time | relevance | path

Searched refs:sshbuf_len (Results 1 – 25 of 74) sorted by relevance

123

/freebsd/crypto/openssh/regress/unittests/sshbuf/
H A Dtest_sshbuf_getput_basic.c80 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 5); in sshbuf_getput_basic_tests()
93 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 1); in sshbuf_getput_basic_tests()
100 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 1); in sshbuf_getput_basic_tests()
108 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 1); in sshbuf_getput_basic_tests()
116 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 10); in sshbuf_getput_basic_tests()
119 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 2); in sshbuf_getput_basic_tests()
123 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 2); in sshbuf_getput_basic_tests()
126 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 2); in sshbuf_getput_basic_tests()
134 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 10); in sshbuf_getput_basic_tests()
137 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 6); in sshbuf_getput_basic_tests()
[all …]
H A Dtest_sshbuf.c53 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 0); in sshbuf_tests()
101 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 4); in sshbuf_tests()
114 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 4); in sshbuf_tests()
116 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 4); in sshbuf_tests()
119 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 4); in sshbuf_tests()
121 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 3); in sshbuf_tests()
126 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 1); in sshbuf_tests()
132 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 1); in sshbuf_tests()
134 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 0); in sshbuf_tests()
150 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 4); in sshbuf_tests()
[all …]
H A Dtest_sshbuf_fuzz.c47 ASSERT_MEM_ZERO_NE(sshbuf_ptr(p1), sshbuf_len(p1)); in sshbuf_fuzz_tests()
55 sz2 = sshbuf_len(p1); in sshbuf_fuzz_tests()
61 ASSERT_SIZE_T_EQ(sshbuf_len(p1), sz2); in sshbuf_fuzz_tests()
66 ASSERT_SIZE_T_EQ(sshbuf_len(p1), sz2 + r); in sshbuf_fuzz_tests()
78 sz2 = sshbuf_len(p1); in sshbuf_fuzz_tests()
85 ASSERT_SIZE_T_EQ(sshbuf_len(p1), sz2); in sshbuf_fuzz_tests()
89 ASSERT_SIZE_T_EQ(sshbuf_len(p1), sz2 - r); in sshbuf_fuzz_tests()
107 ASSERT_MEM_ZERO_NE(sshbuf_ptr(p1), sshbuf_len(p1)); in sshbuf_fuzz_tests()
128 ASSERT_MEM_ZERO_NE(sshbuf_ptr(p1), sshbuf_len(p1)); in sshbuf_fuzz_tests()
H A Dtest_sshbuf_getput_crypto.c85 ASSERT_SIZE_T_EQ(sshbuf_len(p1), sizeof(expbn1) + 4); in sshbuf_getput_crypto_tests()
99 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 0); in sshbuf_getput_crypto_tests()
109 ASSERT_SIZE_T_EQ(sshbuf_len(p1), sizeof(expbn2) + 4 + 1); /* MSB */ in sshbuf_getput_crypto_tests()
124 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 0); in sshbuf_getput_crypto_tests()
135 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 4 + sizeof(expbn1)); in sshbuf_getput_crypto_tests()
140 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 2); in sshbuf_getput_crypto_tests()
155 ASSERT_SIZE_T_EQ(sshbuf_len(p1), sizeof(expbn1) + 3); in sshbuf_getput_crypto_tests()
170 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 65536 + 4); in sshbuf_getput_crypto_tests()
183 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 4 + 1 + sizeof(expbn2)); in sshbuf_getput_crypto_tests()
188 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 2); in sshbuf_getput_crypto_tests()
[all …]
H A Dtest_sshbuf_fixed.c61 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 0); in sshbuf_fixed()
84 ASSERT_SIZE_T_EQ(sshbuf_len(p1), sshbuf_len(p2)); in sshbuf_fixed()
92 ASSERT_SIZE_T_EQ(sshbuf_len(p2), 0); in sshbuf_fixed()
109 ASSERT_SIZE_T_EQ(sshbuf_len(p1), sizeof(test_buf) - 1); in sshbuf_fixed()
111 ASSERT_SIZE_T_EQ(sshbuf_len(p2), sizeof(test_buf) + 4 - 1); in sshbuf_fixed()
113 ASSERT_SIZE_T_EQ(sshbuf_len(p2), 0); in sshbuf_fixed()
116 ASSERT_SIZE_T_EQ(sshbuf_len(p3), sizeof(test_buf) - 1); in sshbuf_fixed()
H A Dtest_sshbuf_misc.c115 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 1); in sshbuf_misc_tests()
124 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 2); in sshbuf_misc_tests()
133 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 4); in sshbuf_misc_tests()
/freebsd/crypto/openssh/
H A Dsshbuf-misc.c69 fprintf(f, "buffer len = %zu\n", sshbuf_len(buf)); in sshbuf_dump()
70 sshbuf_dump_data(sshbuf_ptr(buf), sshbuf_len(buf), f); in sshbuf_dump()
76 size_t i, j, len = sshbuf_len(buf); in sshbuf_dtob16()
100 if (d == NULL || b64 == NULL || sshbuf_len(d) >= SIZE_MAX / 2) in sshbuf_dtob64()
102 if (sshbuf_len(d) == 0) in sshbuf_dtob64()
104 slen = ((sshbuf_len(d) + 2) / 3) * 4 + 1; in sshbuf_dtob64()
107 if (b64_ntop(sshbuf_ptr(d), sshbuf_len(d), s, slen) == -1) { in sshbuf_dtob64()
186 l = sshbuf_len(b); in sshbuf_dtourlb64()
197 l = sshbuf_len(b); in sshbuf_dtourlb64()
218 size_t l = sshbuf_len(buf); in sshbuf_dup_string()
[all …]
H A Dssh_api.c259 if (sshbuf_len(ssh->kex->client_version) == 0 || in ssh_packet_next()
260 sshbuf_len(ssh->kex->server_version) == 0) in ssh_packet_next()
311 *len = sshbuf_len(output); in ssh_output_ptr()
349 if (j >= sshbuf_len(input)) in _ssh_read_banner()
362 if (sshbuf_len(banner) > SSH_MAX_BANNER_LEN) in _ssh_read_banner()
365 if (sshbuf_len(banner) >= 4 && in _ssh_read_banner()
368 debug_f("%.*s", (int)sshbuf_len(banner), in _ssh_read_banner()
384 (remote_version = calloc(1, sshbuf_len(banner))) == NULL) { in _ssh_read_banner()
450 if (sshbuf_len(ssh->kex->server_version) == 0) in _ssh_exchange_banner()
453 sshbuf_len(ssh->kex->server_version) != 0 && in _ssh_exchange_banner()
[all …]
H A Dsshbuf-io.c60 if (sshbuf_len(blob) > SSHBUF_SIZE_MAX) { in sshbuf_load_fd()
66 st.st_size != (off_t)sshbuf_len(blob)) { in sshbuf_load_fd()
108 sshbuf_len(buf)) != sshbuf_len(buf) || close(fd) != 0) { in sshbuf_write_file()
H A Dkexsntrup761x25519.c91 if (sshbuf_len(client_blob) != need) { in kex_kem_sntrup761x25519_enc()
137 sshbuf_ptr(buf), sshbuf_len(buf)); in kex_kem_sntrup761x25519_enc()
145 dump_digest("encoded shared secret:", sshbuf_ptr(buf), sshbuf_len(buf)); in kex_kem_sntrup761x25519_enc()
173 if (sshbuf_len(server_blob) != need) { in kex_kem_sntrup761x25519_dec()
202 sshbuf_ptr(buf), sshbuf_len(buf)); in kex_kem_sntrup761x25519_dec()
209 dump_digest("encoded shared secret:", sshbuf_ptr(buf), sshbuf_len(buf)); in kex_kem_sntrup761x25519_dec()
H A Dpacket.c392 while (sshbuf_len(state->incoming_packet) < dlen) in ssh_packet_stop_discard()
426 if (sshbuf_len(state->input) >= discard) in ssh_packet_start_discard()
428 state->packet_discard = discard - sshbuf_len(state->input); in ssh_packet_start_discard()
742 if (sshbuf_len(in) == 0) in compress_buffer()
749 ssh->state->compression_out_stream.avail_in = sshbuf_len(in); in compress_buffer()
790 ssh->state->compression_in_stream.avail_in = sshbuf_len(in); in uncompress_buffer()
1105 len = sshbuf_len(state->outgoing_packet); in ssh_packet_send2_wrapped()
1120 sshbuf_len(state->outgoing_packet))); in ssh_packet_send2_wrapped()
1124 len = sshbuf_len(state->outgoing_packet); in ssh_packet_send2_wrapped()
1165 len = sshbuf_len(state->outgoing_packet); in ssh_packet_send2_wrapped()
[all …]
H A Dkexc25519.c127 if (sshbuf_len(client_blob) != CURVE25519_SIZE) { in kex_c25519_enc()
152 dump_digest("encoded shared secret:", sshbuf_ptr(buf), sshbuf_len(buf)); in kex_c25519_enc()
175 if (sshbuf_len(server_blob) != CURVE25519_SIZE) { in kex_c25519_dec()
192 dump_digest("encoded shared secret:", sshbuf_ptr(buf), sshbuf_len(buf)); in kex_c25519_dec()
H A Dssh-sk-helper.c109 if (sshbuf_len(req) != 0) in process_sign()
171 if (sshbuf_len(req) != 0) in process_enroll()
176 if (sshbuf_len(challenge) == 0) { in process_enroll()
230 if (sshbuf_len(req) != 0) in process_load_resident()
318 debug_f("received message len %zu", sshbuf_len(req)); in main()
349 debug_f("reply len %zu", sshbuf_len(resp)); in main()
H A Dssh-pkcs11-helper.c263 buf_len = sshbuf_len(iqueue); in process()
296 if (buf_len < sshbuf_len(iqueue)) { in process()
300 consumed = buf_len - sshbuf_len(iqueue); in process()
378 if (sshbuf_len(oqueue) > 0) in main()
402 sshbuf_len(oqueue)); in main()
H A Dnchan.c132 if (sshbuf_len(c->input)) { in chan_ibuf_empty()
154 if (sshbuf_len(c->output)) { in chan_obuf_empty()
262 sshbuf_len(c->output) == 0 && in chan_rcvd_ieof()
344 sshbuf_len(c->extended) > 0) { in chan_is_dead()
346 c->self, c->efd, sshbuf_len(c->extended)); in chan_is_dead()
H A Dkrl.c718 if (sshbuf_len(sect) != 0) { in revoked_certs_generate()
772 if (sshbuf_len(sect) != 0) { in ssh_krl_to_blob()
783 if (sshbuf_len(sect) != 0) { in ssh_krl_to_blob()
795 if (sshbuf_len(sect) != 0) { in ssh_krl_to_blob()
841 if (sshbuf_len(subsect) != 0) { in cert_extension_subsection()
848 name, critical, sshbuf_len(value)); in cert_extension_subsection()
887 while (sshbuf_len(buf) > 0) { in parse_revoked_certs()
898 while (sshbuf_len(subsect) > 0) { in parse_revoked_certs()
944 while (sshbuf_len(subsect) > 0) { in parse_revoked_certs()
964 if (sshbuf_len(subsect) > 0) { in parse_revoked_certs()
[all …]
H A Dsshkey-xmss.c355 if (sshbuf_len(b) == 0) in sshkey_xmss_deserialize_pk_info()
623 POKE_U32(buf, sshbuf_len(enc)); in sshkey_xmss_update_state()
630 if (atomicio(vwrite, fd, sshbuf_mutable_ptr(enc), sshbuf_len(enc)) != in sshkey_xmss_update_state()
631 sshbuf_len(enc)) { in sshkey_xmss_update_state()
939 while (sshbuf_len(padded) % blocksize) { in sshkey_xmss_encrypt_state()
943 encrypted_len = sshbuf_len(padded); in sshkey_xmss_encrypt_state()
948 aadlen = sshbuf_len(encoded); in sshkey_xmss_encrypt_state()
1020 if (sshbuf_len(encoded) < sizeof(XMSS_MAGIC) || in sshkey_xmss_decrypt_state()
1037 if (sshbuf_len(encoded) < authlen || in sshkey_xmss_decrypt_state()
1038 sshbuf_len(encoded) - authlen < encrypted_len) { in sshkey_xmss_decrypt_state()
[all …]
H A Dsshkey.c680 if (sshbuf_len(a->certblob) != sshbuf_len(b->certblob)) in cert_compare()
683 sshbuf_len(a->certblob)) != 0) in cert_compare()
757 if (sshbuf_len(key->cert->certblob) == 0) in to_blob_buf()
823 len = sshbuf_len(b); in to_blob()
1304 if (fwrite(sshbuf_ptr(b), sshbuf_len(b), 1, f) != 1) { in sshkey_write()
1590 while (sshbuf_len(prvbuf) % cipher_blocksize(cipher)) { in sshkey_shield_private()
1599 enclen = sshbuf_len(prvbuf); in sshkey_shield_private()
1605 sshbuf_ptr(prvbuf), sshbuf_len(prvbuf), 0, 0)) != 0) in sshkey_shield_private()
1656 while (sshbuf_len(decrypted)) { in private2_check_padding()
1791 signed_len = sshbuf_len(key->cert->certblob) - sshbuf_len(b); in cert_parse()
[all …]
H A Dkexgex.c72 (r = sshbuf_put_u32(b, sshbuf_len(client_kexinit) + 1)) != 0 || in kexgex_hash()
75 (r = sshbuf_put_u32(b, sshbuf_len(server_kexinit) + 1)) != 0 || in kexgex_hash()
H A Dssh-ecdsa-sk.c189 ((flags & 0x80) == 0 /* ED */) != (sshbuf_len(extensions) == 0)) { in webauthn_check_prepare_hash()
217 if ((r = sshbuf_cmp(wrapper, 0, sshbuf_ptr(m), sshbuf_len(m))) != 0) in webauthn_check_prepare_hash()
294 if (sshbuf_len(b) != 0) { in ssh_ecdsa_sk_verify()
305 if (sshbuf_len(sigbuf) != 0) { in ssh_ecdsa_sk_verify()
H A Dsshbuf.c149 if ((ret = sshbuf_from(sshbuf_ptr(buf), sshbuf_len(buf))) == NULL) in sshbuf_fromb()
281 sshbuf_len(const struct sshbuf *buf) in sshbuf_len() function
401 if (len > sshbuf_len(buf)) in sshbuf_consume()
421 if (len > sshbuf_len(buf)) in sshbuf_consume_end()
H A Dchannels.c891 if (sshbuf_len(c->output) > maxsize) { in channel_not_very_much_buffered_data()
893 c->self, sshbuf_len(c->output), maxsize); in channel_not_very_much_buffered_data()
1030 c->istate, sshbuf_len(c->input), in channel_format_status()
1031 c->ostate, sshbuf_len(c->output), in channel_format_status()
1032 channel_format_extended_usage(c), sshbuf_len(c->extended), in channel_format_status()
1271 sshbuf_len(c->input) < c->remote_window && in channel_pre_open()
1276 if (sshbuf_len(c->output) > 0) { in channel_pre_open()
1282 c->efd, sshbuf_len(c->extended)); in channel_pre_open()
1291 sshbuf_len(c->extended) > 0) in channel_pre_open()
1296 sshbuf_len(c->extended) < c->remote_window) in channel_pre_open()
[all …]
/freebsd/crypto/openssh/regress/unittests/sshkey/
H A Dcommon.c59 for (p = sshbuf_ptr(ret); sshbuf_len(ret) > 0;) { in load_text_file()
60 if (p[sshbuf_len(ret) - 1] == '\r' || in load_text_file()
61 p[sshbuf_len(ret) - 1] == '\t' || in load_text_file()
62 p[sshbuf_len(ret) - 1] == ' ' || in load_text_file()
63 p[sshbuf_len(ret) - 1] == '\n') in load_text_file()
H A Dtest_fuzz.c64 fuzz = fuzz_begin(fuzzers, sshbuf_mutable_ptr(buf), sshbuf_len(buf)); in public_fuzz()
65 ASSERT_INT_EQ(sshkey_from_blob(sshbuf_ptr(buf), sshbuf_len(buf), in public_fuzz()
122 sshbuf_len(buf)); in sshkey_fuzz_tests()
144 sshbuf_len(buf)); in sshkey_fuzz_tests()
167 sshbuf_len(buf)); in sshkey_fuzz_tests()
189 sshbuf_len(buf)); in sshkey_fuzz_tests()
213 sshbuf_len(buf)); in sshkey_fuzz_tests()
235 sshbuf_len(buf)); in sshkey_fuzz_tests()
259 sshbuf_len(buf)); in sshkey_fuzz_tests()
/freebsd/crypto/openssh/regress/misc/fuzz-harness/
H A Dkex_fuzz.cc84 sshbuf_len(ts->sin))) != 0) { in run_kex()
92 sshbuf_len(ts->cin))) != 0) { in run_kex()
199 sshbuf_len(ts->cin)); in do_kex_with_key()
202 sshbuf_len(ts->sin)); in do_kex_with_key()
360 sshbuf_len(ts->smsgs), f) != sshbuf_len(ts->smsgs)) in main()
371 sshbuf_len(ts->cmsgs), f) != sshbuf_len(ts->cmsgs)) in main()

123