libnm-core: empty key is not a pkcs12 file
nmcli> set 802-1x.ca-cert file:///tmp/certs/eaptest_ca_cert.pem (process:31015): libnm-CRITICAL **: crypto_is_pkcs12_data: assertion 'data != NULL' failed Error: failed to set 'ca-cert' property: PEM certificate had no start tag '-----BEGIN CERTIFICATE-----'.
This commit is contained in:
@@ -641,6 +641,9 @@ crypto_is_pkcs12_data (const guint8 *data,
|
||||
GError *local = NULL;
|
||||
gboolean success;
|
||||
|
||||
if (!data_len)
|
||||
return FALSE;
|
||||
|
||||
g_return_val_if_fail (data != NULL, FALSE);
|
||||
|
||||
if (!crypto_init (error))
|
||||
|
@@ -654,6 +654,9 @@ crypto_is_pkcs12_data (const GByteArray *data)
|
||||
|
||||
g_return_val_if_fail (data != NULL, FALSE);
|
||||
|
||||
if (!data->len)
|
||||
return FALSE;
|
||||
|
||||
success = crypto_verify_pkcs12 (data, NULL, &error);
|
||||
if (success == FALSE) {
|
||||
/* If the error was just a decryption error, then it's pkcs#12 */
|
||||
|
Reference in New Issue
Block a user