From bf195ef982c04299c734f42c6537b5dfbfa8beb9 Mon Sep 17 00:00:00 2001 From: Lubos Racansky Date: Thu, 7 Sep 2023 16:27:43 +0200 Subject: [PATCH 1/2] Fix #1011: Set powerauth-java-crypto version to 1.5.1-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f0cd851d0..968c34b4d 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 4.0.1 - 1.5.0 + 1.5.1-SNAPSHOT 1.7.0 1.76 From 1cac2c6ee35a1d7c7d43303cac34d195cfb0c253 Mon Sep 17 00:00:00 2001 From: Lubos Racansky Date: Thu, 7 Sep 2023 16:57:29 +0200 Subject: [PATCH 2/2] Pass version to validateTokenDigest --- .../app/server/service/behavior/tasks/TokenBehavior.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/powerauth-java-server/src/main/java/io/getlime/security/powerauth/app/server/service/behavior/tasks/TokenBehavior.java b/powerauth-java-server/src/main/java/io/getlime/security/powerauth/app/server/service/behavior/tasks/TokenBehavior.java index f33a1b37b..a66726875 100644 --- a/powerauth-java-server/src/main/java/io/getlime/security/powerauth/app/server/service/behavior/tasks/TokenBehavior.java +++ b/powerauth-java-server/src/main/java/io/getlime/security/powerauth/app/server/service/behavior/tasks/TokenBehavior.java @@ -68,10 +68,7 @@ import java.security.PrivateKey; import java.security.PublicKey; import java.security.spec.InvalidKeySpecException; -import java.util.Base64; -import java.util.Calendar; -import java.util.Date; -import java.util.Optional; +import java.util.*; /** * Behavior that contains methods related to simple token-based authentication. @@ -313,8 +310,10 @@ public ValidateTokenResponse validateToken(ValidateTokenRequest request) throws null, request.getNonce(), token.getTokenId()); + // TODO Roman - just make to compile, but activation#version contains only the major version + final String version = Objects.toString(activation.getVersion()); // Validate MAC token - isTokenValid = tokenVerifier.validateTokenDigest(nonce, timestamp, tokenSecret, tokenDigest); + isTokenValid = tokenVerifier.validateTokenDigest(nonce, timestamp, version, tokenSecret, tokenDigest); } final ValidateTokenResponse response = new ValidateTokenResponse();