diff options
author | Fabio Berger <me@fabioberger.com> | 2018-09-30 14:31:34 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-09-30 14:31:34 +0800 |
commit | de7470d936ae800adb45752bc36c8325845c8896 (patch) | |
tree | d644c402f1f10794dd15aba7e4a9223b46b1832e /packages/order-utils | |
parent | b9eb2b3918b4b1a891c07a4ccb5eb40847ae90fc (diff) | |
parent | ac14dd2b29b42ef4d2a46db9b70d4d30cf9bd40f (diff) | |
download | dexon-sol-tools-de7470d936ae800adb45752bc36c8325845c8896.tar dexon-sol-tools-de7470d936ae800adb45752bc36c8325845c8896.tar.gz dexon-sol-tools-de7470d936ae800adb45752bc36c8325845c8896.tar.bz2 dexon-sol-tools-de7470d936ae800adb45752bc36c8325845c8896.tar.lz dexon-sol-tools-de7470d936ae800adb45752bc36c8325845c8896.tar.xz dexon-sol-tools-de7470d936ae800adb45752bc36c8325845c8896.tar.zst dexon-sol-tools-de7470d936ae800adb45752bc36c8325845c8896.zip |
merge development
Diffstat (limited to 'packages/order-utils')
-rw-r--r-- | packages/order-utils/CHANGELOG.json | 11 | ||||
-rw-r--r-- | packages/order-utils/CHANGELOG.md | 4 | ||||
-rw-r--r-- | packages/order-utils/package.json | 22 | ||||
-rw-r--r-- | packages/order-utils/src/signature_utils.ts | 4 |
4 files changed, 29 insertions, 12 deletions
diff --git a/packages/order-utils/CHANGELOG.json b/packages/order-utils/CHANGELOG.json index 1162bbc83..b486d6503 100644 --- a/packages/order-utils/CHANGELOG.json +++ b/packages/order-utils/CHANGELOG.json @@ -1,5 +1,16 @@ [ { + "version": "1.0.6", + "changes": [ + { + "note": + "Add signerAddress normalization to `isValidECSignature` to avoid `invalid address recovery` error if caller supplies a checksummed address", + "pr": 1096 + } + ], + "timestamp": 1538157789 + }, + { "timestamp": 1537907159, "version": "1.0.5", "changes": [ diff --git a/packages/order-utils/CHANGELOG.md b/packages/order-utils/CHANGELOG.md index 8372ddf16..5109b9040 100644 --- a/packages/order-utils/CHANGELOG.md +++ b/packages/order-utils/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v1.0.6 - _September 28, 2018_ + + * Add signerAddress normalization to `isValidECSignature` to avoid `invalid address recovery` error if caller supplies a checksummed address (#1096) + ## v1.0.5 - _September 25, 2018_ * Dependencies updated diff --git a/packages/order-utils/package.json b/packages/order-utils/package.json index f83b9cc14..832a112dc 100644 --- a/packages/order-utils/package.json +++ b/packages/order-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/order-utils", - "version": "1.0.5", + "version": "1.0.6", "engines": { "node": ">=6.12" }, @@ -38,7 +38,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/order-utils/README.md", "devDependencies": { - "@0xproject/dev-utils": "^1.0.10", + "@0xproject/dev-utils": "^1.0.11", "@0xproject/tslint-config": "^1.0.7", "@types/bn.js": "^4.11.0", "@types/lodash": "4.14.104", @@ -57,19 +57,19 @@ "typescript": "3.0.1" }, "dependencies": { - "@0xproject/assert": "^1.0.11", - "@0xproject/base-contract": "^2.0.5", - "@0xproject/json-schemas": "^1.0.4", - "@0xproject/types": "^1.1.1", - "@0xproject/typescript-typings": "^2.0.2", - "@0xproject/utils": "^1.0.11", - "@0xproject/web3-wrapper": "^3.0.1", + "@0xproject/assert": "^1.0.12", + "@0xproject/base-contract": "^3.0.0", + "@0xproject/json-schemas": "^1.0.5", + "@0xproject/types": "^1.1.2", + "@0xproject/typescript-typings": "^3.0.0", + "@0xproject/utils": "^2.0.0", + "@0xproject/web3-wrapper": "^3.0.2", "@types/node": "*", "bn.js": "^4.11.8", - "ethereum-types": "^1.0.8", + "ethereum-types": "^1.0.9", "ethereumjs-abi": "0.6.5", "ethereumjs-util": "^5.1.1", - "ethers": "3.0.22", + "ethers": "4.0.0-beta.14", "lodash": "^4.17.5" }, "publishConfig": { diff --git a/packages/order-utils/src/signature_utils.ts b/packages/order-utils/src/signature_utils.ts index c0c9e71a7..3b656d3fc 100644 --- a/packages/order-utils/src/signature_utils.ts +++ b/packages/order-utils/src/signature_utils.ts @@ -174,6 +174,7 @@ export const signatureUtils = { assert.isHexString('data', data); assert.doesConformToSchema('signature', signature, schemas.ecSignatureSchema); assert.isETHAddressHex('signerAddress', signerAddress); + const normalizedSignerAddress = signerAddress.toLowerCase(); const msgHashBuff = ethUtil.toBuffer(data); try { @@ -184,7 +185,8 @@ export const signatureUtils = { ethUtil.toBuffer(signature.s), ); const retrievedAddress = ethUtil.bufferToHex(ethUtil.pubToAddress(pubKey)); - return retrievedAddress === signerAddress; + const normalizedRetrievedAddress = retrievedAddress.toLowerCase(); + return normalizedRetrievedAddress === normalizedSignerAddress; } catch (err) { return false; } |