From 13553b825903ebae80752ff3265841a1e95e420f Mon Sep 17 00:00:00 2001 From: Sai Ranjit Tummalapalli Date: Tue, 3 Sep 2024 18:25:23 +0530 Subject: [PATCH] refactor: pick encryption key from env file Signed-off-by: Sai Ranjit Tummalapalli --- app/screens/CredentialDetailsW3C.tsx | 3 +- ios/AdeyaWallet.xcodeproj/project.pbxproj | 4 +-- patches/@credo-ts+indy-vdr+0.5.3.patch | 40 +++++++++++++++++++++++ 3 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 patches/@credo-ts+indy-vdr+0.5.3.patch diff --git a/app/screens/CredentialDetailsW3C.tsx b/app/screens/CredentialDetailsW3C.tsx index a655c022..d4c3d6a2 100644 --- a/app/screens/CredentialDetailsW3C.tsx +++ b/app/screens/CredentialDetailsW3C.tsx @@ -16,6 +16,7 @@ import { toString as toQRCodeString } from 'qrcode' import React, { useCallback, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import { DeviceEventEmitter, Image, ImageBackground, Platform, StyleSheet, Text, View } from 'react-native' +import { Config } from 'react-native-config' import RNHTMLtoPDF from 'react-native-html-to-pdf' import { SafeAreaView } from 'react-native-safe-area-context' import Toast from 'react-native-toast-message' @@ -342,7 +343,7 @@ const CredentialDetailsW3C: React.FC = ({ navigation, ro }) // eslint-disable-next-line import/namespace - const encryptedToken = CryptoJS.AES.encrypt(dataToEncrypt, 'dataEncryptionKey').toString() + const encryptedToken = CryptoJS.AES.encrypt(dataToEncrypt, Config.DATA_ENCRYPTION_KEY!).toString() const qrCodeSvg = await generateQRCodeString(encryptedToken) diff --git a/ios/AdeyaWallet.xcodeproj/project.pbxproj b/ios/AdeyaWallet.xcodeproj/project.pbxproj index 39351130..21ad1903 100644 --- a/ios/AdeyaWallet.xcodeproj/project.pbxproj +++ b/ios/AdeyaWallet.xcodeproj/project.pbxproj @@ -507,7 +507,7 @@ ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = AdeyaWallet/AdeyaWallet.entitlements; - CURRENT_PROJECT_VERSION = 43; + CURRENT_PROJECT_VERSION = 45; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = Z5W7KRPGHZ; ENABLE_BITCODE = NO; @@ -545,7 +545,7 @@ CODE_SIGN_ENTITLEMENTS = AdeyaWallet/AdeyaWallet.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 43; + CURRENT_PROJECT_VERSION = 45; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = Z5W7KRPGHZ; INFOPLIST_FILE = AdeyaWallet/Info.plist; diff --git a/patches/@credo-ts+indy-vdr+0.5.3.patch b/patches/@credo-ts+indy-vdr+0.5.3.patch new file mode 100644 index 00000000..03283b6e --- /dev/null +++ b/patches/@credo-ts+indy-vdr+0.5.3.patch @@ -0,0 +1,40 @@ +diff --git a/node_modules/@credo-ts/indy-vdr/build/anoncreds/IndyVdrAnonCredsRegistry.js b/node_modules/@credo-ts/indy-vdr/build/anoncreds/IndyVdrAnonCredsRegistry.js +index 30ded2c..5928d48 100644 +--- a/node_modules/@credo-ts/indy-vdr/build/anoncreds/IndyVdrAnonCredsRegistry.js ++++ b/node_modules/@credo-ts/indy-vdr/build/anoncreds/IndyVdrAnonCredsRegistry.js +@@ -182,7 +182,7 @@ class IndyVdrAnonCredsRegistry { + } + // Format the schema id based on the type of the credential definition id + const schemaId = credentialDefinitionId.startsWith('did:indy') +- ? (0, identifiers_1.getDidIndySchemaId)(pool.indyNamespace, namespaceIdentifier, schema.schema.name, schema.schema.version) ++ ? (0, identifiers_1.getDidIndySchemaId)(pool.indyNamespace, schema.schema.issuerId, schema.schema.name, schema.schema.version) + : schema.schema.schemaId; + return { + credentialDefinitionId, +@@ -624,7 +624,7 @@ class IndyVdrAnonCredsRegistry { + } + } + async fetchIndySchemaWithSeqNo(agentContext, seqNo, did) { +- var _a, _b; ++ var _a, _b, _c; + const indyVdrPoolService = agentContext.dependencyManager.resolve(pool_1.IndyVdrPoolService); + const { pool } = await indyVdrPoolService.getPoolForDid(agentContext, did); + agentContext.config.logger.debug(`Getting transaction with seqNo '${seqNo}' from ledger '${pool.indyNamespace}'`); +@@ -637,14 +637,15 @@ class IndyVdrAnonCredsRegistry { + return null; + } + const schema = (_b = response.result.data) === null || _b === void 0 ? void 0 : _b.txn.data; +- const schemaId = (0, anoncreds_1.getUnqualifiedSchemaId)(did, schema.data.name, schema.data.version); ++ const schemaDid = (_c = response.result.data) === null || _c === void 0 ? void 0 : _c.txn.metadata.from; ++ const schemaId = (0, anoncreds_1.getUnqualifiedSchemaId)(schemaDid, schema.data.name, schema.data.version); + return { + schema: { + schemaId, + attr_name: schema.data.attr_names, + name: schema.data.name, + version: schema.data.version, +- issuerId: did, ++ issuerId: schemaDid, + seqNo, + }, + indyNamespace: pool.indyNamespace,