Fix IPsec key pair generator for secp256k1 EC and add properer naming to UI (#6817)

Key generation for the "256" EC does not work as secp256r1 does not
exist in OpenSSL, it's called secp256k1.

Also the names shown in the UI are ambiguous as there are several curves
with 256, 384 or 521 bits.
This commit is contained in:
Manuel Faux 2023-09-02 16:43:12 +02:00 committed by GitHub
parent c48d8aa6c4
commit eafbf81b24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -137,7 +137,7 @@ class KeyPairsController extends ApiMutableModelControllerBase
$attrs['private_key_type'] = OPENSSL_KEYTYPE_EC;
switch ($size ?? '384') {
case '256';
$attrs['curve_name'] = "secp256r1";
$attrs['curve_name'] = "prime256v1";
break;
case '384';
$attrs['curve_name'] = "secp384r1";

View File

@ -72,9 +72,9 @@
<option data-type='rsa' value="3072">3072</option>
<option data-type='rsa' value="4096">4096</option>
<option data-type='rsa' value="8192">8192</option>
<option data-type='ecdsa' value="256">256</option>
<option data-type='ecdsa' value="384">384</option>
<option data-type='ecdsa' value="521">521</option>
<option data-type='ecdsa' value="256">NIST P-256</option>
<option data-type='ecdsa' value="384">NIST P-384</option>
<option data-type='ecdsa' value="521">NIST P-521</option>
</select>
<button id="keygen" type="button" class="btn btn-secondary" title="{{ lang._('Generate new.') }}" data-toggle="tooltip">
<i class="fa fa-fw fa-gear"></i>