]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Zap copy of secret in RC4 string-to-key
authorDylan Gray <35609490+Dylan-MSFT@users.noreply.github.com>
Fri, 13 Jul 2018 22:09:01 +0000 (15:09 -0700)
committerGreg Hudson <ghudson@mit.edu>
Mon, 16 Jul 2018 14:09:26 +0000 (10:09 -0400)
Commit b8814745049b5f401e3ae39a81dc1e14598ae48c (ticket 8576) added a
zero-terminated copy of the input string in
krb5int_arcfour_string_to_key().  This copy should be zeroed when
freed as the input string typically contains a password.

[ghudson@mit.edu: rewrote commit message]

ticket: 8713 (new)

src/lib/crypto/krb/s2k_rc4.c

index 081a91217c6922d0b7bd027cef01ade2ab4ad030..f7e699d608eeaeba98968c6235e5a88dd6503570 100644 (file)
@@ -25,7 +25,7 @@ krb5int_arcfour_string_to_key(const struct krb5_keytypes *ktp,
     if (utf8 == NULL)
         return err;
     err = k5_utf8_to_utf16le(utf8, &copystr, &copystrlen);
-    free(utf8);
+    zapfree(utf8, string->length);
     if (err)
         return err;