Uploaded image for project: 'MINA SSHD'
  1. MINA SSHD
  2. SSHD-78

PEMGeneratorHostKeyProvider doesn't close PEMWriter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.3.0
    • 0.4.0
    • None

    Description

      When using PEMGeneratorHostKeyProvider to read and write generated key in PEM format, the class does not properly close the instance of PEMWriter. This results in the key not being written to the file.

      protected void doWriteKeyPair(KeyPair kp, OutputStream os) throws Exception {
      PEMWriter w = new PEMWriter(new OutputStreamWriter(os));
      w.writeObject(kp);
      // This is missing (and should be in a finally block)
      w.close();
      }

      Attachments

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              plaflamme Philippe Laflamme
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: