]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Check timestamp in PKINIT kdcpreauth module
authorThomas Calderon <thomas.calderon@ssi.gouv.fr>
Fri, 6 Feb 2015 14:55:34 +0000 (15:55 +0100)
committerGreg Hudson <ghudson@mit.edu>
Thu, 19 Feb 2015 17:47:30 +0000 (12:47 -0500)
RFC 4556 requires the KDC to check the PKAuthenticator timestamp in
order to prevent replays after the five-minute clock skew window.  (A
replay attack has minimal value; it only causes the KDC to issue a
ticket which an attacker cannot decrypt.)

[ghudson@mit.edu: rewrote commit message; squashed with typo fix;
style fixes]

ticket: 8123 (new)

src/plugins/preauth/pkinit/pkinit_srv.c

index 5639fca9519620708cb5ad1ed9144f11b2d9b50c..b4727412936f4b33da8c0e1ddfe14276af438667 100644 (file)
@@ -429,6 +429,11 @@ pkinit_server_verify_padata(krb5_context context,
             goto cleanup;
         }
 
+        retval = krb5_check_clockskew(context,
+                                      auth_pack->pkAuthenticator.ctime);
+        if (retval)
+            goto cleanup;
+
         /* check dh parameters */
         if (auth_pack->clientPublicValue != NULL) {
             retval = server_check_dh(context, plgctx->cryptoctx,