Skip to content

Commit

Permalink
Fix: Updated Hash generation function for Transaction data base64
Browse files Browse the repository at this point in the history
  • Loading branch information
josmilan committed Jan 10, 2025
1 parent cba12c3 commit 16f2281
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import com.ewc.eudi_wallet_oidc_android.services.utils.JwtUtils.isValidJWT
import com.ewc.eudi_wallet_oidc_android.services.utils.JwtUtils.parseJWTForPayload
import com.ewc.eudi_wallet_oidc_android.services.utils.X509SanRequestVerifier
import com.ewc.eudi_wallet_oidc_android.services.utils.walletUnitAttestation.WalletAttestationUtil
import com.ewc.eudi_wallet_oidc_android.services.utils.walletUnitAttestation.WalletAttestationUtil.generateHash
import com.github.decentraliseddataexchange.presentationexchangesdk.PresentationExchange
import com.github.decentraliseddataexchange.presentationexchangesdk.models.MatchedCredential
import com.google.gson.Gson
Expand Down Expand Up @@ -53,6 +54,7 @@ import java.net.HttpURLConnection
import java.net.InetAddress
import java.net.URL
import java.nio.charset.StandardCharsets
import java.security.MessageDigest

class VerificationService : VerificationServiceInterface {

Expand Down Expand Up @@ -929,7 +931,7 @@ class VerificationService : VerificationServiceInterface {
if (presentationRequest.transactionDdata?.isNotEmpty() == true) {
val transactionDataItem =
presentationRequest.transactionDdata?.getOrNull(0)
val hash = SDJWTService().calculateSHA256Hash(transactionDataItem)
val hash = generateHash(transactionDataItem?:"")
Log.d("processToken:", "transactionDataItem has added:${hash}")
if (transactionDataItem != null) {
claims["transaction_data_hashes"] = listOf(hash)
Expand Down

0 comments on commit 16f2281

Please sign in to comment.