MINA SSHD
  1. MINA SSHD
  2. SSHD-78

PEMGeneratorHostKeyProvider doesn't close PEMWriter

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.3.0
    • Fix Version/s: 0.4.0
    • Labels:
      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(); }

        Issue Links

          Activity

          Philippe Laflamme created issue -
          Guillaume Nodet made changes -
          Field Original Value New Value
          Assignee Guillaume Nodet [ gnt ]
          Hide
          Guillaume Nodet added a comment -

          Committing to https://svn.apache.org/repos/asf/mina/sshd/trunk ...
          M sshd-core/src/main/java/org/apache/sshd/server/keyprovider/PEMGeneratorHostKeyProvider.java
          Committed r939038

          Show
          Guillaume Nodet added a comment - Committing to https://svn.apache.org/repos/asf/mina/sshd/trunk ... M sshd-core/src/main/java/org/apache/sshd/server/keyprovider/PEMGeneratorHostKeyProvider.java Committed r939038
          Guillaume Nodet made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 0.4.0 [ 12314444 ]
          Resolution Fixed [ 1 ]
          Hide
          Guillaume Nodet added a comment -

          Committing to https://svn.apache.org/repos/asf/mina/sshd/trunk ...
          M sshd-core/src/main/java/org/apache/sshd/server/keyprovider/PEMGeneratorHostKeyProvider.java
          Committed r939040

          Flush instead of close. The output stream is closed by the caller.

          Show
          Guillaume Nodet added a comment - Committing to https://svn.apache.org/repos/asf/mina/sshd/trunk ... M sshd-core/src/main/java/org/apache/sshd/server/keyprovider/PEMGeneratorHostKeyProvider.java Committed r939040 Flush instead of close. The output stream is closed by the caller.
          Guillaume Nodet made changes -
          Link This issue is duplicated by SSHD-103 [ SSHD-103 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          53d 16h 32m 1 Guillaume Nodet 28/Apr/10 18:22

            People

            • Assignee:
              Guillaume Nodet
              Reporter:
              Philippe Laflamme
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development