From dd2cd283ba35d35335e118c91fd95c0a00de693f Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Tue, 2 Nov 2021 14:46:06 +0100 Subject: add timezone to verifiable pendingRequestId's --- .../AuthenticatedEncryptionPendingRequestIdGenerationStrategy.java | 2 +- .../eaaf/core/impl/utils/SecurePendingRequestIdGenerationStrategy.java | 2 +- .../AuthenticatedEncryptionPendingRequestIdGenerationStrategyTest.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'eaaf_core_utils/src') diff --git a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/AuthenticatedEncryptionPendingRequestIdGenerationStrategy.java b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/AuthenticatedEncryptionPendingRequestIdGenerationStrategy.java index 83ea7da0..ca1db67d 100644 --- a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/AuthenticatedEncryptionPendingRequestIdGenerationStrategy.java +++ b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/AuthenticatedEncryptionPendingRequestIdGenerationStrategy.java @@ -70,7 +70,7 @@ public class AuthenticatedEncryptionPendingRequestIdGenerationStrategy private static final int ENCODED_TOKEN_PARTS = 2; private static final String TOKEN_SEPARATOR = "|"; private static final DateTimeFormatter TOKEN_TEXTUAL_DATE_FORMAT = - DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss SSS"); + DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss SSS ZZ").withZoneUTC(); private int maxPendingRequestIdLifeTime = 300; private final int maxPendingReqIdSize = 1024; diff --git a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/SecurePendingRequestIdGenerationStrategy.java b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/SecurePendingRequestIdGenerationStrategy.java index cfb4ed88..5cac4cb0 100644 --- a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/SecurePendingRequestIdGenerationStrategy.java +++ b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/SecurePendingRequestIdGenerationStrategy.java @@ -70,7 +70,7 @@ public class SecurePendingRequestIdGenerationStrategy private static final int ENCODED_TOKEN_PARTS = 3; private static final String TOKEN_SEPARATOR = "|"; private static final DateTimeFormatter TOKEN_TEXTUAL_DATE_FORMAT = - DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss SSS"); + DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss SSS ZZ").withZoneUTC(); private int maxPendingRequestIdLifeTime = 300; private final int maxPendingReqIdSize = 1024; diff --git a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/utils/test/AuthenticatedEncryptionPendingRequestIdGenerationStrategyTest.java b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/utils/test/AuthenticatedEncryptionPendingRequestIdGenerationStrategyTest.java index 09a9543a..93ef17b9 100644 --- a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/utils/test/AuthenticatedEncryptionPendingRequestIdGenerationStrategyTest.java +++ b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/utils/test/AuthenticatedEncryptionPendingRequestIdGenerationStrategyTest.java @@ -191,7 +191,7 @@ public class AuthenticatedEncryptionPendingRequestIdGenerationStrategyTest { @Test public void wrongFormatWrongDate() throws EaafException, JoseException, UnsupportedEncodingException { - String payLoad = "2020-01-01 12:01:55 111" + "|" + String payLoad = "2020-01-01 12:01:55 111 +00:00" + "|" + RandomStringUtils.randomAlphanumeric(25); String extPendingId = generateEncryptedPendingId(payLoad, -- cgit v1.2.3