@smithy/signature-v4a 3.1.14 → 3.2.1
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.
package/dist-cjs/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var signatureV4 = require('@smithy/signature-v4');
|
|
4
|
-
var
|
|
5
|
-
var utilUtf8 = require('@smithy/util-utf8');
|
|
4
|
+
var serde = require('@smithy/core/serde');
|
|
6
5
|
|
|
7
6
|
const REGION_HEADER = signatureV4.REGION_SET_PARAM.toLowerCase();
|
|
8
7
|
const ONE_AS_4_BYTES = [0x00, 0x00, 0x00, 0x01];
|
|
@@ -32,7 +31,7 @@ const getSigV4aSigningKey = async (sha256, accessKey, secretKey) => {
|
|
|
32
31
|
outputBufferWriter = buildFixedInputBuffer(outputBufferWriter, accessKey, trial);
|
|
33
32
|
const secretKey = inputKeyBuf.subarray(0, inputKeyLength);
|
|
34
33
|
const hash = new sha256(secretKey);
|
|
35
|
-
const hashVal =
|
|
34
|
+
const hashVal = serde.toUint8Array(outputBufferWriter);
|
|
36
35
|
hash.update(hashVal);
|
|
37
36
|
const hashedOutput = await hash.digest();
|
|
38
37
|
if (isBiggerThanNMinus2(hashedOutput)) {
|
|
@@ -9955,10 +9954,10 @@ class SignatureV4a extends signatureV4.SignatureV4Base {
|
|
|
9955
9954
|
const ecdsa = new export_Ec("p256");
|
|
9956
9955
|
const key = ecdsa.keyFromPrivate(privateKey);
|
|
9957
9956
|
const hash = new this.sha256();
|
|
9958
|
-
hash.update(
|
|
9957
|
+
hash.update(serde.toUint8Array(stringToSign));
|
|
9959
9958
|
const hashResult = await hash.digest();
|
|
9960
9959
|
const signature = key.sign(hashResult);
|
|
9961
|
-
return
|
|
9960
|
+
return serde.toHex(new Uint8Array(signature.toDER()));
|
|
9962
9961
|
}
|
|
9963
9962
|
}
|
|
9964
9963
|
|
package/dist-es/SignatureV4a.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getCanonicalHeaders } from "@smithy/signature-v4";
|
|
3
|
-
import { getPayloadHash } from "@smithy/signature-v4";
|
|
4
|
-
import { hasHeader } from "@smithy/signature-v4";
|
|
5
|
-
import { prepareRequest } from "@smithy/signature-v4";
|
|
6
|
-
import { SignatureV4Base } from "@smithy/signature-v4";
|
|
7
|
-
import { toHex } from "@smithy/util-hex-encoding";
|
|
8
|
-
import { toUint8Array } from "@smithy/util-utf8";
|
|
1
|
+
import { toHex, toUint8Array } from "@smithy/core/serde";
|
|
2
|
+
import { ALGORITHM_IDENTIFIER_V4A, AMZ_DATE_HEADER, AUTH_HEADER, SHA256_HEADER, SignatureV4Base, TOKEN_HEADER, getCanonicalHeaders, getPayloadHash, hasHeader, prepareRequest, } from "@smithy/signature-v4";
|
|
9
3
|
import { REGION_HEADER } from "./constants";
|
|
10
4
|
import { createSigV4aScope, getSigV4aSigningKey } from "./credentialDerivation";
|
|
11
5
|
import { Ec } from "./elliptic/Ec";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { toUint8Array } from "@smithy/core/serde";
|
|
1
2
|
import { ALGORITHM_IDENTIFIER_V4A, KEY_TYPE_IDENTIFIER } from "@smithy/signature-v4";
|
|
2
|
-
import { toUint8Array } from "@smithy/util-utf8";
|
|
3
3
|
import { N_MINUS_TWO, ONE_AS_4_BYTES, TWOFIFTYSIX_AS_4_BYTES } from "./constants";
|
|
4
4
|
const signingKeyCache = {};
|
|
5
5
|
const cacheQueue = [];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { SignatureV4Base } from "@smithy/signature-v4";
|
|
1
|
+
import { SignatureV4Base, type SignatureV4CryptoInit, type SignatureV4Init } from "@smithy/signature-v4";
|
|
3
2
|
import type { HttpRequest, RequestSigner } from "@smithy/types";
|
|
4
3
|
/**
|
|
5
4
|
* @public
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/signature-v4a",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Asymmetric addon for the @smithy/signature-v4 package",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
@@ -25,15 +25,13 @@
|
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"sideEffects": true,
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@smithy/
|
|
28
|
+
"@smithy/core": "^3.24.1",
|
|
29
|
+
"@smithy/signature-v4": "^5.4.1",
|
|
29
30
|
"@smithy/types": "^4.14.1",
|
|
30
|
-
"@smithy/util-hex-encoding": "^4.2.2",
|
|
31
|
-
"@smithy/util-utf8": "^4.2.2",
|
|
32
31
|
"tslib": "^2.6.2"
|
|
33
32
|
},
|
|
34
33
|
"devDependencies": {
|
|
35
34
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
36
|
-
"@smithy/protocol-http": "^5.3.14",
|
|
37
35
|
"concurrently": "7.0.0",
|
|
38
36
|
"downlevel-dts": "0.10.1",
|
|
39
37
|
"elliptic": "6.5.5",
|