[java-identity-provider] branch master updated: IDP-1575 - Duo AuthAPI support breaks in timestamp generation

Scott Cantor cantor.2 at osu.edu
Tue Mar 3 18:39:42 EST 2020


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=a4e4b032cf5d85de21775b51ff8779af3b8721de

The following commit(s) were added to refs/heads/master by this push:
       new  a4e4b03   IDP-1575 - Duo AuthAPI support breaks in timestamp generation
a4e4b03 is described below

commit a4e4b032cf5d85de21775b51ff8779af3b8721de
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Mar 3 18:39:03 2020 -0500

    IDP-1575 - Duo AuthAPI support breaks in timestamp generation
    
    https://issues.shibboleth.net/jira/browse/IDP-1575
---
 .../shibboleth/idp/authn/duo/impl/DuoSupport.java  |  4 +--
 .../idp/authn/duo/impl/DuoSupportTest.java         | 33 ++++++++++++++++++++++
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/DuoSupport.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/DuoSupport.java
index 7d9081e..76a50a4 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/DuoSupport.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/DuoSupport.java
@@ -33,7 +33,7 @@ import java.io.UnsupportedEncodingException;
 import java.net.URI;
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
-import java.time.LocalDateTime;
+import java.time.ZonedDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -130,7 +130,7 @@ public final class DuoSupport {
         final String ikey = duo.getIntegrationKey();
         final String skey = duo.getSecretKey();
         final int sigVersion = 2;
-        final String date = RFC_2822_DATE_FORMAT.format(LocalDateTime.now());
+        final String date = RFC_2822_DATE_FORMAT.format(ZonedDateTime.now());
         final String canon = canonRequest(request, date, sigVersion);
         final String sig = Util.hmacSign(skey, canon);
 
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/duo/impl/DuoSupportTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/duo/impl/DuoSupportTest.java
new file mode 100644
index 0000000..83db838
--- /dev/null
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/duo/impl/DuoSupportTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements.  See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.shibboleth.idp.authn.duo.impl;
+
+import java.time.ZonedDateTime;
+
+import org.testng.annotations.Test;
+
+/**
+ * Unit test for Duo support code.
+ */
+public class DuoSupportTest {
+
+    @Test public void testDateFormatting() {
+        DuoSupport.RFC_2822_DATE_FORMAT.format(ZonedDateTime.now());
+    }
+
+}
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list