Skip to content

Commit

Permalink
Release of version 2.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
fengsongAWS committed May 18, 2020
1 parent 7c452a9 commit 3f45ed7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 134 deletions.
33 changes: 0 additions & 33 deletions .github/ISSUE_TEMPLATE/---bug_report.md

This file was deleted.

24 changes: 0 additions & 24 deletions .github/ISSUE_TEMPLATE/---feature-request.md

This file was deleted.

22 changes: 0 additions & 22 deletions .github/ISSUE_TEMPLATE/---questions.md

This file was deleted.

46 changes: 0 additions & 46 deletions .github/workflows/stale_issue.yml

This file was deleted.

17 changes: 9 additions & 8 deletions device/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ var inherits = require('util').inherits;

//npm deps
var mqtt = require('mqtt');
var crypto = require('crypto-js');
var hmacSHA256 = require('crypto-js/hmac-sha256');
var sha256 = require('crypto-js/sha256');

//app deps
var exceptions = require('./lib/exceptions');
Expand Down Expand Up @@ -57,16 +58,16 @@ function getDateString(dateTimeString) {
}

function getSignatureKey(key, dateStamp, regionName, serviceName) {
var kDate = crypto.HmacSHA256(dateStamp, 'AWS4' + key, {
var kDate = hmacSHA256(dateStamp, 'AWS4' + key, {
asBytes: true
});
var kRegion = crypto.HmacSHA256(regionName, kDate, {
var kRegion = hmacSHA256(regionName, kDate, {
asBytes: true
});
var kService = crypto.HmacSHA256(serviceName, kRegion, {
var kService = hmacSHA256(serviceName, kRegion, {
asBytes: true
});
var kSigning = crypto.HmacSHA256('aws4_request', kService, {
var kSigning = hmacSHA256('aws4_request', kService, {
asBytes: true
});
return kSigning;
Expand All @@ -85,15 +86,15 @@ function signUrl(method, scheme, hostname, path, queryParams, accessId, secretKe
canonicalHeaders + // headers
'\n' + // required
signedHeaders + '\n' + // signed header list
crypto.SHA256(payload, {
sha256(payload, {
asBytes: true
}); // hash of payload (empty string)

if (debug === true) {
console.log('canonical request: ' + canonicalRequest + '\n');
}

var hashedCanonicalRequest = crypto.SHA256(canonicalRequest, {
var hashedCanonicalRequest = sha256(canonicalRequest, {
asBytes: true
});

Expand All @@ -116,7 +117,7 @@ function signUrl(method, scheme, hostname, path, queryParams, accessId, secretKe
console.log('signing key: ' + signingKey + '\n');
}

var signature = crypto.HmacSHA256(stringToSign, signingKey, {
var signature = hmacSHA256(stringToSign, signingKey, {
asBytes: true
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "aws-iot-device-sdk",
"description": "AWS IoT Node.js SDK for Embedded Devices",
"version": "2.2.5",
"version": "2.2.6",
"author": {
"name": "Amazon Web Services",
"email": "",
Expand Down

0 comments on commit 3f45ed7

Please sign in to comment.