importScripts('common.js');

function continuouslyGenerateRsaKey()
{
    var extractable = false;
    var usages = ['encrypt', 'decrypt'];
    // Note that the modulus length is small.
    var algorithm = {name: "RSAES-PKCS1-v1_5", modulusLength: 512, publicExponent: hexStringToUint8Array("010001")};

    return crypto.subtle.generateKey(algorithm, extractable, usages).then(function(result) {
        // Infinite recursion intentional!
        return continuouslyGenerateRsaKey();
    });
}

// Starts a Promise which continually generates new RSA keys.
var unusedPromise = continuouslyGenerateRsaKey();

// Inform the outer script that the worker started.
postMessage("Worker started");

importScripts('common.js');

function continuouslyGenerateRsaKey()
{
    var extractable = false;
    var usages = ['sign', 'verify'];
    // Note that the modulus length is small.
    var algorithm = {name: "RSASSA-PKCS1-v1_5", modulusLength: 512, publicExponent: hexStringToUint8Array("010001"), hash: {name: 'sha-1'}};

    return crypto.subtle.generateKey(algorithm, extractable, usages).then(function(result) {
        // Infinite recursion intentional!
        return continuouslyGenerateRsaKey();
    });
}

// Starts a Promise which continually generates new RSA keys.
var unusedPromise = continuouslyGenerateRsaKey();

// Inform the outer script that the worker started.
postMessage("Worker started");

Remove a lingering usage of RSA-ES.
[webcrypto] Remove a lingering usage of RSA-ES.

TBR=jww
BUG=372920,245025

Review URL: https://codereview.chromium.org/344503003

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@176389 bbb929c8-8fbe-4397-9dbb-9b2b20218538
