Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Feature: Add KMS data key decryption #106

Merged
merged 2 commits into from
May 4, 2017

Conversation

dgreene-r7
Copy link
Contributor

This PR adds decryption support for secrets encrypted against data keys generated via KMS. generateDataKey(). The initial implementation requires all secrets to be encrypted via the aes-256-cbc cipher.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 92.944% when pulling 5323d64 on feature-add-kms-datakey-decryption into f397c25 on master.

const validResponse = {
KeyId: 'arn:aws:kms:us-east-1:ACCOUNT:key/SOME-UUID',
PlainText: Buffer.from('this-is-a-secret', 'utf8').toString('base64')
Plaintext: Buffer.from(plaintext, 'base64')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did the key name change from PlainText to Plaintext?

Copy link
Contributor Author

@dgreene-r7 dgreene-r7 May 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out I mucked it up in the original tests. The property returned from KMS.decrypt() is actually Plaintext.

Copy link
Contributor

@fmitchell-r7 fmitchell-r7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks for getting this working!

@dgreene-r7 dgreene-r7 merged commit c048373 into master May 4, 2017
@dgreene-r7 dgreene-r7 deleted the feature-add-kms-datakey-decryption branch May 4, 2017 19:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants