zig/lib/std/crypto
Igor Anić ca752c61c0 tls.Client: fix out of bounds panic
When calculating how much ciphertext from the stream can fit into
user and internal buffers we should also take into account ciphertext
data which are already in internal buffer.

Fixes: 15226

Tested with
[this](https://github.com/ziglang/zig/issues/15226#issuecomment-2218809140).
Using client with different read buffers until I, hopefully, understood
what is happening.

Not relevant to this fix, but this
[part](95d9292a7a/lib/std/crypto/tls/Client.zig (L988-L991))
is still mystery to me. Why we don't use free_size in buf_cap
calculation. Seems like rudiment from previous implementation without iovec.
2024-07-12 03:07:15 -04:00
..
25519 crypto.edwards25519: add the ability to check for group membership (#20175) 2024-06-04 10:11:05 +02:00
aes std.builtin.Endian: make the tags lower case 2023-10-31 21:37:35 -04:00
Certificate extract std.posix from std.os 2024-03-19 11:45:09 -07:00
pcurves std.crypto.pcurves.*: simpler, smaller, faster u64 addition with carry (#19644) 2024-04-14 01:13:22 +02:00
tls tls.Client: fix out of bounds panic 2024-07-12 03:07:15 -04:00
aegis.zig {aegis,aes_gcm}: fix overflow with large inputs on 32-bit systems (#19270) 2024-03-12 22:56:28 +00:00
aes.zig x86_64: fix incorrect mnemonic selection 2024-02-25 11:22:10 +01:00
aes_gcm.zig {aegis,aes_gcm}: fix overflow with large inputs on 32-bit systems (#19270) 2024-03-12 22:56:28 +00:00
aes_ocb.zig x86_64: implement shifts of big integers 2024-02-12 05:25:07 +01:00
argon2.zig std.crypto.pwhash: Add recommended parameters (#20527) 2024-07-07 20:18:33 +00:00
ascon.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
bcrypt.zig std.crypto.pwhash: Add recommended parameters (#20527) 2024-07-07 20:18:33 +00:00
benchmark.zig std.crypto.pcurves.*: simpler, smaller, faster u64 addition with carry (#19644) 2024-04-14 01:13:22 +02:00
blake2.zig std.builtin.Endian: make the tags lower case 2023-10-31 21:37:35 -04:00
blake3.zig x86_64: implement more shuffles 2024-02-25 11:22:10 +01:00
Certificate.zig std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
chacha20.zig std.crypto.chacha: fix typo in XChaChaIETF.stream() (#20399) 2024-06-23 13:20:18 +00:00
cmac.zig x86_64: fix std test failures 2023-11-03 23:18:21 -04:00
ecdsa.zig Rename der_encoded_max_length to der_encoded_length_max 2024-04-20 16:27:56 -07:00
errors.zig crypto.edwards25519: add the ability to check for group membership (#20175) 2024-06-04 10:11:05 +02:00
ff.zig std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
ghash_polyval.zig Deprecate suggestVectorSize in favor of suggestVectorLength 2024-01-01 16:18:57 +01:00
hash_composition.zig x86_64: implement enough to pass unicode tests 2023-10-23 22:42:18 -04:00
hkdf.zig x86_64: implement enough to pass unicode tests 2023-10-23 22:42:18 -04:00
hmac.zig Remove redundant test name prefixes now that test names are fully qualified 2024-02-26 15:18:31 -08:00
isap.zig std.builtin.Endian: make the tags lower case 2023-10-31 21:37:35 -04:00
keccak_p.zig sha3.keccak: allow Keccak[f=200] (#20181) 2024-06-04 10:10:46 +02:00
md5.zig Remove redundant test name prefixes now that test names are fully qualified 2024-02-26 15:18:31 -08:00
ml_kem.zig std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
modes.zig update codebase to use @memset and @memcpy 2023-04-28 13:24:43 -07:00
pbkdf2.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
phc_encoding.zig x86_64: fix std test failures 2023-11-03 23:18:21 -04:00
poly1305.zig Remove redundant test name prefixes now that test names are fully qualified 2024-02-26 15:18:31 -08:00
salsa20.zig std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
scrypt.zig std.crypto.pwhash: Add recommended parameters (#20527) 2024-07-07 20:18:33 +00:00
sha1.zig std.builtin.Endian: make the tags lower case 2023-10-31 21:37:35 -04:00
sha2.zig std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
sha3.zig Delete compile errors for deprecated decls 2024-05-03 13:27:30 -07:00
siphash.zig std.builtin.Endian: make the tags lower case 2023-10-31 21:37:35 -04:00
test.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
tlcsprng.zig handle visionos target OS tag in the compiler 2024-05-09 15:04:15 +02:00
tls.zig std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
utils.zig std: promote tests to doctests 2024-03-21 14:11:46 -07:00