Skip to content
  • Raphael Kubo da Costa's avatar
    openconnect: Make FSID passphrase + empty private key combination work. · c9f4c071
    Raphael Kubo da Costa authored and Jan Grulich's avatar Jan Grulich committed
    It should be possible to usen FSID-protected key passphrase with a user
    certificate and no private key.
    
    This was not working as expected because we were always calling
    openconnect_set_client_cert() with QByteArray::data(). The latter will pass
    an empty string rather than nullptr if it is empty, which can be the case
    for `key` if it is not set. This causes openconnect_set_client_cert() to use
    that empty string rather than handle the null argument case, and we would be
    unexpectedly prompted for a key password when trying to connect.
    
    Avoid running into this by explicitly passing `nullptr` when we have an
    empty `key`.
    
    BUG: 443770
    
    
    (cherry picked from commit a76f4d4b)
    c9f4c071