mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2026-03-06 17:11:24 +00:00
Use Web Crypto & Node crypto for RSA signing and verifying (#999)
Also, when generating RSA keys in JS, generate them with p < q, as per the spec. Also, when generating RSA keys using Web Crypto or Node crypto, swap the generated p and q around, so that will satisfy p < q in most browsers (but not old Microsoft Edge, 50% of the time) and so that we can use the generated u coefficient (p^-1 mod q in OpenPGP, q^-1 mod p in RFC3447). Then, when signing and verifying, swap p and q again, so that the key hopefully satisfies Safari's requirement that p > q, and so that we can keep using u again.
This commit is contained in:
committed by
Daniel Huigens
parent
e20d727d76
commit
6e7f399eb3
@@ -275,7 +275,7 @@ function dearmor(input) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
return;
|
||||
}
|
||||
@@ -307,7 +307,7 @@ function dearmor(input) {
|
||||
}
|
||||
await writer.ready;
|
||||
await writer.close();
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
await writer.abort(e);
|
||||
}
|
||||
}));
|
||||
@@ -325,11 +325,11 @@ function dearmor(input) {
|
||||
}
|
||||
await writer.ready;
|
||||
await writer.close();
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
await writer.abort(e);
|
||||
}
|
||||
});
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user