Use new values from /api/bootstrap

This commit is contained in:
pehmo1 2021-08-31 20:46:25 +03:00
parent c5a452933a
commit d8d5b5f6bc
1 changed files with 7 additions and 9 deletions

View File

@ -103,11 +103,15 @@ function onKeyGen() {
let algorithm;
if (authority.certificate.algorithm == "rsa") {
algorithm = getAlgorithmParameters(
window.authority.certificate.key_type_specific, "generatekey");
window.authority.certificate.signature_algorithm, "generatekey");
}
if (authority.certificate.algorithm == "ec") {
algorithm = getAlgorithmParameters(
window.authority.certificate.curve, "generatekey");
if(authority.certificate.curve.startsWith("secp")) {
algorithm = getAlgorithmParameters(
"ECDSA", "generatekey");
algorithm.algorithm.namedCurve =
`P-${authority.certificate.curve.slice(4,7)}`;
}
}
if ("hash" in algorithm.algorithm)
algorithm.algorithm.hash.name = window.authority.certificate.hash_algorithm;
@ -312,12 +316,6 @@ async function onHashChanged() {
success: async function(authority) {
window.authority = authority
// convert "sha512" to "SHA-512"
window.authority.certificate.hash_algorithm =
(window.authority.certificate.hash_algorithm.slice(0,3) +
"-" + window.authority.certificate.hash_algorithm.slice(3))
.toUpperCase();
var prefix = "unknown";
for (i in DEVICE_KEYWORDS) {
var keyword = DEVICE_KEYWORDS[i];