From 628dd1da1db19f5c7eb4730b12629d98710a4a31 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Tue, 8 Feb 2022 22:37:20 -0800 Subject: [PATCH] replace zero with crypto secureZero --- src/aws_authentication.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aws_authentication.zig b/src/aws_authentication.zig index 1be1ef3..6b55ef2 100644 --- a/src/aws_authentication.zig +++ b/src/aws_authentication.zig @@ -25,9 +25,9 @@ pub const Credentials = struct { }; } pub fn deinit(self: Self) void { - for (self.secret_key) |_, i| self.secret_key[i] = 0; - self.allocator.free(self.access_key); + std.crypto.utils.secureZero(u8, self.secret_key); self.allocator.free(self.secret_key); + self.allocator.free(self.access_key); if (self.session_token) |t| self.allocator.free(t); } };