Skip to content

Commit

Permalink
UI/transit add missed algorithms follow up (#9520)
Browse files Browse the repository at this point in the history
* fix NaN error for version history of aes128-gcm96 transit secrets

* convert aes128-gcm96 keys to milliseconds to work with date-frmo-now helper
  • Loading branch information
Noelle Daley authored and Monkeychip committed Aug 11, 2020
1 parent cd345d3 commit 7b8f0c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui/app/serializers/transit-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ export default DS.RESTSerializer.extend({
assign(payload, payload.data);
delete payload.data;
// timestamps for these two are in seconds...
if (payload.type === 'aes256-gcm96' || payload.type === 'chacha20-poly1305') {
if (
payload.type === 'aes256-gcm96' ||
payload.type === 'chacha20-poly1305' ||
payload.type === 'aes128-gcm96'
) {
for (let version in payload.keys) {
payload.keys[version] = payload.keys[version] * 1000;
}
Expand Down
1 change: 1 addition & 0 deletions ui/app/templates/partials/transit-form-show.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
{{#if (or
(eq key.type "aes256-gcm96")
(eq key.type "chacha20-poly1305")
(eq key.type "aes128-gcm96")
)
}}
{{#each-in key.keys as |version creationTimestamp|}}
Expand Down

0 comments on commit 7b8f0c9

Please sign in to comment.