libnm-core: macsec: don't require a cak in verify()

CAK is a connection secret and can be NULL for various reasons
(agent-owned, no permissions to get secrets, etc.). verify() must not
require it.

Fixes: 474a0dbfbe
This commit is contained in:
Beniamino Galvani 2018-11-02 10:54:26 +01:00
parent a764061807
commit 8d5b01619b

View file

@ -245,6 +245,12 @@ verify_macsec_key (const char *key, gboolean cak, GError **error)
{
int req_len;
/* CAK is a connection secret and can be NULL for various
* reasons (agent-owned, no permissions to get secrets, etc.)
*/
if (cak && !key)
return TRUE;
if (!key || !key[0]) {
g_set_error_literal (error,
NM_CONNECTION_ERROR,