Skip to content

Commit

Permalink
Merge pull request #386 from jolocom/release/v4.0.1
Browse files Browse the repository at this point in the history
Release/v4.0.1
  • Loading branch information
VolkerSchiewe committed Dec 9, 2019
2 parents d1cc76d + 5c69a4d commit 34b2887
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jolocom-lib",
"version": "4.0.0",
"version": "4.0.1",
"description": "Unified library for interacting with the Jolocom identity solution",
"main": "js/index.js",
"files": [
Expand Down Expand Up @@ -76,7 +76,7 @@
"create-hash": "^1.2.0",
"cred-types-jolocom-core": "^0.0.11",
"detect-node": "^2.0.4",
"eccrypto": "^1.1.2",
"eccrypto": "rootstock/eccrypto#485e11f163093fb6e0d5263fa46ed5075dedfe88",
"ethereumjs-tx": "^1.3.7",
"ethereumjs-util": "^6.1.0",
"ethers": "^4.0.27",
Expand Down
12 changes: 12 additions & 0 deletions tests/misc/dependencies.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { expect } from 'chai'

describe('Dependency updates', () => {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const packageJson = require('../../package.json')
it('should test if eccrypto was changed', () => {
expect(packageJson.dependencies.eccrypto).to.eq(
'rootstock/eccrypto#485e11f163093fb6e0d5263fa46ed5075dedfe88',
'This fork is used because there was a bug in React-Native - https://github.com/jolocom/jolocom-lib/issues/384',
)
})
})
4 changes: 3 additions & 1 deletion ts/vaultedKeyProvider/softwareProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export class SoftwareKeyProvider implements IVaultedKeyProvider {
)

// Encrypt asymmetrically
const encryptedKey = await eccrypto.encrypt(publicKey, Buffer.from(symKey))
const encryptedKey = await eccrypto.encrypt(publicKey, symKey)
return {
keys: [
{
Expand Down Expand Up @@ -318,6 +318,8 @@ export class SoftwareKeyProvider implements IVaultedKeyProvider {
if (!encryptedKey) throw new Error('Not encrypted for these keys')

// decrypt asymmetrically
// FIXME We are using a fork of eccrypto to fix a bug in eccrypto.decrypt() see https://github.com/jolocom/jolocom-lib/issues/384
// change this back once this https://github.com/bitchan/eccrypto/pull/47 is released
const symKey = await eccrypto.decrypt(
privateKey,
this.parseEncryptedData(encryptedKey.cipher),
Expand Down
5 changes: 2 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2480,10 +2480,9 @@ ecc-jsbn@~0.1.1:
jsbn "~0.1.0"
safer-buffer "^2.1.0"

eccrypto@^1.1.2:
eccrypto@rootstock/eccrypto#485e11f163093fb6e0d5263fa46ed5075dedfe88:
version "1.1.2"
resolved "https://registry.yarnpkg.com/eccrypto/-/eccrypto-1.1.2.tgz#7962402f923044d25a802d7369447b0a563873b1"
integrity sha512-4z/uF18h2TFdqqtFSUvlwRD9epzmeEEUZ4nVMv3ox+jy+V7AxU9s3nLoEDDbptTUlkAbAp5bPfhaS7H4naoFqg==
resolved "https://codeload.github.com/rootstock/eccrypto/tar.gz/485e11f163093fb6e0d5263fa46ed5075dedfe88"
dependencies:
acorn "7.1.0"
elliptic "6.5.1"
Expand Down

0 comments on commit 34b2887

Please sign in to comment.