Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-21283

BasicSSHUserPrivateKey.getPassphrase breaks nullness contract of interface

XMLWordPrintable

      SSHUserPrivateKey.getPassphrase is documented to return null if the private key is not protected by passphrase. Yet the constructor of BasicSSHUserPrivateKey does not check for an empty passphrase, and Secret.fromString never returns null, so getPassphrase returns a non-null result even if none was specified (in this case .getPassphrase().getPlainText().isEmpty()).

            stephenconnolly Stephen Connolly
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: