/* Returns TRUE if keys are equals, FALSE otherwise  */
gboolean keys_are_equals(decryption_key_t *k1, decryption_key_t *k2)
/* Returns TRUE if keys are equals, FALSE otherwise  */
gboolean keys_are_equals(decryption_key_t *k1, decryption_key_t *k2)
{
    if ((k1==NULL) || (k2==NULL))
        return FALSE;
    if (g_string_equal(k1->key,k2->key) &&
        (k1->bits == k2->bits) &&
        (k1->type == k2->type))
    {
        if ((k1->ssid == NULL) && (k2->ssid == NULL))
            return TRUE;
        return byte_array_equal(k1->ssid,k2->ssid);
    }
    return FALSE;
}