]> git.ipfire.org Git - thirdparty/strongswan.git/blobdiff - src/pki/commands/self.c
pki: Query private key for supported signature schemes
[thirdparty/strongswan.git] / src / pki / commands / self.c
index 6f7adef0f8c4c0f38a7b1691b50458c07e00ea00..a08ee993166c262f701162c427b89fa79f76efe8 100644 (file)
@@ -378,6 +378,11 @@ static int self()
                rng->destroy(rng);
        }
        scheme = get_signature_scheme(private, digest, pss);
+       if (!scheme)
+       {
+               error = "no signature scheme found";
+               goto end;
+       }
 
        cert = lib->creds->create(lib->creds, CRED_CERTIFICATE, CERT_X509,
                                                BUILD_SIGNING_KEY, private, BUILD_PUBLIC_KEY, public,