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

BasicSSHUserPrivateKey.getPassphrase breaks nullness contract of interface

    XMLWordPrintable

Details

    Description

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

      Attachments

        Activity

          jglick Jesse Glick created issue -
          stephenconnolly Stephen Connolly made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          stephenconnolly Stephen Connolly made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 153146 ] JNJira + In-Review [ 194482 ]
          stephenconnolly Stephen Connolly made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

              Created:
              Updated:
              Resolved: