Use unencoded hash function and bump version to v1.3.6.cnaf.20230726

pull/1611/head
Enrico Vianello 2023-07-26 10:55:10 +01:00
parent 07aeb26312
commit 521019fed8
6 changed files with 7 additions and 8 deletions

View File

@ -22,7 +22,7 @@
<parent>
<artifactId>openid-connect-parent</artifactId>
<groupId>org.mitre</groupId>
<version>1.3.6.cnaf-20230725</version>
<version>1.3.6.cnaf-20230726</version>
<relativePath>..</relativePath>
</parent>
<artifactId>openid-connect-client</artifactId>

View File

@ -22,7 +22,7 @@
<parent>
<artifactId>openid-connect-parent</artifactId>
<groupId>org.mitre</groupId>
<version>1.3.6.cnaf-20230725</version>
<version>1.3.6.cnaf-20230726</version>
<relativePath>..</relativePath>
</parent>
<artifactId>openid-connect-common</artifactId>

View File

@ -20,7 +20,6 @@
*/
package org.mitre.oauth2.model;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@ -282,7 +281,7 @@ public class OAuth2AccessTokenEntity implements OAuth2AccessToken {
* @return the tokenValueHash
*/
@Basic
@Column(name = "token_value_hash")
@Column(name = "token_value_hash", length = 64)
public String getTokenValueHash() {
return tokenValueHash;
}
@ -351,7 +350,7 @@ public class OAuth2AccessTokenEntity implements OAuth2AccessToken {
public void hashMe() {
if (jwtValue != null) {
this.tokenValueHash = Hashing.sha256()
.hashString(jwtValue.serialize(), StandardCharsets.UTF_8)
.hashUnencodedChars(jwtValue.serialize())
.toString();
}
}

View File

@ -23,7 +23,7 @@
<parent>
<groupId>org.mitre</groupId>
<artifactId>openid-connect-parent</artifactId>
<version>1.3.6.cnaf-20230725</version>
<version>1.3.6.cnaf-20230726</version>
<relativePath>..</relativePath>
</parent>
<build>

View File

@ -83,7 +83,7 @@ public class JpaOAuth2TokenRepository implements OAuth2TokenRepository {
public OAuth2AccessTokenEntity getAccessTokenByValue(
String accessTokenValue) {
String atHashed = Hashing.sha256()
.hashString(accessTokenValue, StandardCharsets.UTF_8)
.hashUnencodedChars(accessTokenValue)
.toString();
TypedQuery<OAuth2AccessTokenEntity> query = manager.createNamedQuery(
OAuth2AccessTokenEntity.QUERY_BY_TOKEN_VALUE_HASH,

View File

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.mitre</groupId>
<artifactId>openid-connect-parent</artifactId>
<version>1.3.6.cnaf-20230725</version>
<version>1.3.6.cnaf-20230726</version>
<name>MITREid Connect</name>
<packaging>pom</packaging>
<parent>