@novasamatech/host-papp 0.5.0-4 → 0.5.0-5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import { toHex } from '@polkadot-api/utils';
2
2
  import { createNanoEvents } from 'nanoevents';
3
3
  import { Bytes, Enum, Tuple, str } from 'scale-ts';
4
4
  import { isAbortError } from '../helpers/utils.js';
5
- import { ENCR_SECRET_SEED_SIZE, EncrPubKey, SS_SECRET_SEED_SIZE, SsPubKey, createEncrSecret, createSharedSecret, createSsSecret, createStableSeed, createSymmetricKey, decrypt, getEncrPub, getSsPub, khash, mergeBytes, stringToBytes, } from './crypto.js';
5
+ import { ENCR_SECRET_SEED_SIZE, EncrPubKey, SS_SECRET_SEED_SIZE, SsPubKey, createEncrSecret, createRandomSeed, createSharedSecret, createSsSecret, createSymmetricKey, decrypt, getEncrPub, getSsPub, khash, mergeBytes, stringToBytes, } from './crypto.js';
6
6
  import { createSecretStorage } from './secretStorage.js';
7
7
  import { createSession } from './statementStore.js';
8
8
  // codecs
@@ -150,17 +150,13 @@ function retrieveSessionTopic({ payload, encrSecret, ssPublicKey, }) {
150
150
  async function getSecretKeys(appId, secretStorage) {
151
151
  let ssSecret = await secretStorage.readSsSecret();
152
152
  if (!ssSecret) {
153
- // TODO randomize seed
154
- // For testing purpose only
155
- const seed = createStableSeed(appId, SS_SECRET_SEED_SIZE);
153
+ const seed = createRandomSeed(appId, SS_SECRET_SEED_SIZE);
156
154
  ssSecret = createSsSecret(seed);
157
155
  await secretStorage.writeSsSecret(ssSecret);
158
156
  }
159
157
  let encrSecret = await secretStorage.readEncrSecret();
160
158
  if (!encrSecret) {
161
- // TODO randomize seed
162
- // For testing purpose only
163
- const seed = createStableSeed(appId, ENCR_SECRET_SEED_SIZE);
159
+ const seed = createRandomSeed(appId, ENCR_SECRET_SEED_SIZE);
164
160
  encrSecret = createEncrSecret(seed);
165
161
  await secretStorage.writeEncrSecret(encrSecret);
166
162
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@novasamatech/host-papp",
3
3
  "type": "module",
4
- "version": "0.5.0-4",
4
+ "version": "0.5.0-5",
5
5
  "description": "Polkadot app integration",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {