zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit c4a1b54ebefb77122d2055b09bc0bf01bbc1d8b6 (tree)
parent c724cc64871e0e7274b232689c07417e59de5918
Author: Purrie <purriebrightstar@gmail.com>
Date:   Fri, 21 Jul 2023 15:18:12 +0200

tls client interface consistency fix

Client for tls was using a function that wasn't declared on the
interface for it. The issue wasn't apparent because net stream
implemented that function.

I changed it to keep the interface promise of what's required to be
compatible with the tls client functionality.

Diffstat:
Mlib/std/crypto/tls/Client.zig | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/std/crypto/tls/Client.zig b/lib/std/crypto/tls/Client.zig @@ -662,7 +662,11 @@ pub fn init(stream: anytype, ca_bundle: Certificate.Bundle, host: []const u8) In P.AEAD.encrypt(ciphertext, auth_tag, &out_cleartext, ad, nonce, p.client_handshake_key); const both_msgs = client_change_cipher_spec_msg ++ finished_msg; - try stream.writeAll(&both_msgs); + var both_msgs_vec = [_]std.os.iovec_const{.{ + .iov_base = &both_msgs, + .iov_len = both_msgs.len, + }}; + try stream.writevAll(&both_msgs_vec); const client_secret = hkdfExpandLabel(P.Hkdf, p.master_secret, "c ap traffic", &handshake_hash, P.Hash.digest_length); const server_secret = hkdfExpandLabel(P.Hkdf, p.master_secret, "s ap traffic", &handshake_hash, P.Hash.digest_length);