remove incorrect getter/setter for cleartext - it should not be stored inside the payload!

This commit is contained in:
Dan Mills 2008-12-01 18:08:59 -08:00
Родитель 54044ae3e1
Коммит 11b0ef4698
1 изменённых файлов: 2 добавлений и 5 удалений

Просмотреть файл

@ -86,11 +86,6 @@ CryptoWrapper.prototype = {
this.payload.encryption = value;
},
get cleartext() this.payload.cleartext,
set cleartext(value) {
this.payload.cleartext = value;
},
get ciphertext() this.payload.ciphertext,
set ciphertext(value) {
this.payload.ciphertext = value;
@ -106,6 +101,7 @@ CryptoWrapper.prototype = {
let symkey = yield meta.getKey(self.cb, privkey, passphrase);
this.ciphertext = crypto.encrypt(json.encode([this.cleartext]), symkey, meta.bulkIV);
this.cleartext = null;
self.done();
},
@ -124,6 +120,7 @@ CryptoWrapper.prototype = {
// note: payload is wrapped in an array, see _encrypt
this.cleartext = json.decode(crypto.decrypt(this.ciphertext, symkey, meta.bulkIV))[0];
this.ciphertext = null;
self.done(this.cleartext);
},