Skip to content

Commit

Permalink
fix: encryption parameters parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
gllm-dev committed Apr 2, 2024
1 parent 1d7cba1 commit c9fe41d
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 30 deletions.
52 changes: 26 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfort/shield-js",
"version": "0.1.1",
"version": "0.1.2",
"description": "",
"author": "Openfort",
"repository": {
Expand Down
12 changes: 10 additions & 2 deletions src/core/ShieldSDK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ export class ShieldSDK {
return {
secret: data.secret,
userEntropy: data.user_entropy,
encryptionParameters: data.encryption_parameters,
encryptionParameters: {
salt: data.salt,
iterations: data.iterations,
length: data.length,
digest: data.digest,
},
};
} catch (error) {
console.error(`unexpected error: ${error}`);
Expand All @@ -51,7 +56,10 @@ export class ShieldSDK {
body: JSON.stringify({
"secret": share.secret,
"user_entropy": share.userEntropy,
"encryption_parameters": share.encryptionParameters,
"salt": share.encryptionParameters?.salt,
"iterations": share.encryptionParameters?.iterations,
"length": share.encryptionParameters?.length,
"digest": share.encryptionParameters?.digest,
}),
});

Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const VERSION = "0.1.1";
export const VERSION = "0.1.2";
export const PACKAGE = "@openfort/shield-js";

0 comments on commit c9fe41d

Please sign in to comment.