server side encryption WIP

This commit is contained in:
azivner
2017-11-10 22:55:19 -05:00
parent 8f1eedfe0d
commit ec49bf0cca
11 changed files with 101 additions and 38 deletions
+3 -1
View File
@@ -7,7 +7,9 @@ function setDataKey(req, decryptedDataKey) {
return req.session.protectedSessionId;
}
function getDataKey(req, protectedSessionId) {
function getDataKey(req) {
const protectedSessionId = req.headers['x-protected-session-id'];
if (protectedSessionId && req.session.protectedSessionId === protectedSessionId) {
return req.session.decryptedDataKey;
}