Zig Version
0.14.0-dev.2647+5322459a0
Steps to Reproduce and Observed Behavior
The error is evident in the Client.zig but I will also how to reproduce it with openssl s_server.
openssl s_server -accept localhost:3000 -tls1_3
Run this program. program should block to give a chance to trigger key update
const std = @import("std");
const Client = std.crypto.tls.Client;
pub fn main() !void {
const addr = try std.net.Address.parseIp("127.0.0.1", 3000);
const stream = try std.net.tcpConnectToAddress(addr);
var client = try Client.init(stream, .{
.ca = .no_verification,
.host = .no_verification
});
var buf: [20]u8 = undefined;
// block here
_ = try client.readAll(stream, buf[0..]);
std.debug.print("data: {s}\n", .{buf});
_ = try client.write(stream, "ending connection...\n");
_ = try client.writeEnd(stream, "", true);
}
type K at s_server terminal to trigger key update with KeyUpdateRequest.update_requested
type any 20 characters to unblock the program
Using default temp DH parameters
ACCEPT
-----BEGIN SSL SESSION PARAMETERS-----
MHMCAQECAgMEBAITAQQgShd2vbIgI+z6R/uAIJMk5o99v7bluT/4Tg4TgYu+t+8E
ICyjPo2S7OSzEzNodsRlDisLGkbbwuvcHl+FijWlElh2oQYCBGeJGt2iBAICHCCk
BgQEAQAAAK4HAgUAgerr3rMDAgEX
-----END SSL SESSION PARAMETERS-----
Shared ciphers:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:TLS_AES_256_GCM_SHA384:ECDHE-RSA-AES256-GCM-SHA384:TLS_CHACHA20_POLY1305_SHA256:ECDHE-RSA-CHACHA20-POLY1305
Signature Algorithms: ECDSA+SHA256:ECDSA+SHA384:RSA+SHA256:RSA+SHA384:RSA+SHA512:RSA-PSS+SHA256:RSA-PSS+SHA384:RSA-PSS+SHA512:RSA-PSS+SHA256:RSA-PSS+SHA384:RSA-PSS+SHA512:RSA+SHA1:Ed25519
Shared Signature Algorithms: ECDSA+SHA256:ECDSA+SHA384:RSA+SHA256:RSA+SHA384:RSA+SHA512:RSA-PSS+SHA256:RSA-PSS+SHA384:RSA-PSS+SHA512:RSA-PSS+SHA256:RSA-PSS+SHA384:RSA-PSS+SHA512:Ed25519
Supported groups: <NULL>:secp256r1:secp384r1:x25519
Shared groups: secp256r1:secp384r1:x25519
CIPHER is TLS_AES_128_GCM_SHA256
Secure Renegotiation IS NOT supported
K
SSL_do_handshake -> 1
ffffffffffffffffffffffffffffffffffffffff
ERROR
40B7930FF6720000:error:0A000119:SSL routines:ssl3_get_record:decryption failed or bad record mac:../ssl/record/ssl3_record.c:622:
shutting down SSL
CONNECTION CLOSED
tls client tried to close connection before it sends key update.
Expected Behavior
behave as stated in rfc 8446
Zig Version
0.14.0-dev.2647+5322459a0
Steps to Reproduce and Observed Behavior
The error is evident in the Client.zig but I will also how to reproduce it with openssl s_server.
Run this program. program should block to give a chance to trigger key update
type K at s_server terminal to trigger key update with KeyUpdateRequest.update_requested
type any 20 characters to unblock the program
tls client tried to close connection before it sends key update.
Expected Behavior
behave as stated in rfc 8446