diff --git a/src/packet/secret_key.js b/src/packet/secret_key.js index 10b22814..ea7edc84 100644 --- a/src/packet/secret_key.js +++ b/src/packet/secret_key.js @@ -415,6 +415,9 @@ SecretKey.prototype.postCloneTypeFix = function() { if (this.keyid) { this.keyid = type_keyid.fromClone(this.keyid); } + if (this.s2k) { + this.s2k = type_s2k.fromClone(this.s2k); + } }; export default SecretKey; diff --git a/test/general/key.js b/test/general/key.js index 87edd60e..18e4af4b 100644 --- a/test/general/key.js +++ b/test/general/key.js @@ -2210,6 +2210,16 @@ describe('Key', function() { describe('V4', versionSpecificTests); + tryTests('V4 - With Worker', versionSpecificTests, { + if: typeof window !== 'undefined' && window.Worker, + before: async function() { + await openpgp.initWorker({ path: '../dist/openpgp.worker.js' }); + }, + after: function() { + openpgp.destroyWorker(); + } + }); + let v5_keysVal; let aead_protectVal; tryTests('V5', versionSpecificTests, {