Don't encrypt keys

This commit is contained in:
David Humphrey (:humph) david.humphrey@senecacollege.ca 2013-11-29 16:00:41 -05:00
parent 58f57cca19
commit 0ccc9e4dc2
1 changed files with 3 additions and 6 deletions

View File

@ -18,8 +18,7 @@ define(function(require) {
};
CryptoWrappedContext.prototype.get = function(key, callback) {
var that = this;
var encryptedKey = this.encrypt(key);
this.context.get(encryptedKey, function(err, value) {
this.context.get(key, function(err, value) {
if(err) {
callback(err);
return;
@ -31,13 +30,11 @@ define(function(require) {
});
};
CryptoWrappedContext.prototype.put = function(key, value, callback) {
var encryptedKey = this.encrypt(key);
var encryptedValue = this.encrypt(value);
this.context.put(encryptedKey, encryptedValue, callback);
this.context.put(key, encryptedValue, callback);
};
CryptoWrappedContext.prototype.delete = function(key, callback) {
var encryptedKey = this.encrypt(key);
this.context.delete(encryptedKey, callback);
this.context.delete(key, callback);
};
// Custom formatting for encryption objects <-> strings