BasicSSHUserPrivateKey.getPassphrase breaks nullness contract of interface

This issue is archived. You can view it, but you can't modify it. Learn more

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()).

            Assignee:
            Stephen Connolly
            Reporter:
            Jesse Glick
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: