fix(certgen): accept ECDSA as EC algorithm alias in JCA key type matching
Some Android 10 devices (e.g. Sony H8296) report EC private key algorithm as "ECDSA" instead of "EC", causing IllegalArgumentException in certificate signing and a SIGSEGV crash in the keystore process. Closes #4
This commit is contained in:
@@ -240,7 +240,7 @@ object CertificateGenerator {
|
||||
|
||||
val signerAlgorithm =
|
||||
when (signingKeyPair.private.algorithm) {
|
||||
"EC" -> "SHA256withECDSA"
|
||||
"EC", "ECDSA" -> "SHA256withECDSA"
|
||||
"RSA" -> "SHA256withRSA"
|
||||
else -> throw IllegalArgumentException("Unsupported signing key: ${signingKeyPair.private.algorithm}")
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ object NativeCertGen {
|
||||
}
|
||||
|
||||
val algorithmName = when (certs[0].publicKey.algorithm) {
|
||||
"EC" -> "EC"
|
||||
"EC", "ECDSA" -> "EC"
|
||||
"RSA" -> "RSA"
|
||||
else -> certs[0].publicKey.algorithm
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user