check if parsing of the RSA public key in an X.509 certificate was successful
authorAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 23 May 2008 19:22:37 +0000 (19:22 -0000)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 23 May 2008 19:22:37 +0000 (19:22 -0000)
src/libstrongswan/plugins/x509/x509_cert.c

index ff176b7..a562f8b 100644 (file)
@@ -740,6 +740,11 @@ static bool parse_certificate(private_x509_cert_t *this)
                                                                        CRED_PUBLIC_KEY, KEY_RSA,
                                                                        BUILD_BLOB_ASN1_DER, chunk_clone(object),
                                                                        BUILD_END);
+                                               if (this->public_key == NULL)
+                                               {
+                                                       DBG1("could not create RSA public key");
+                                                       goto end;
+                                               }
                                                break;
                                        default:
                                                DBG1("parsing key type %d failed", key_alg);