Skip to content

Get SFTP key pair mode working#29098

Merged
sharidas merged 1 commit into
masterfrom
fix-sftp-issue
Oct 6, 2017
Merged

Get SFTP key pair mode working#29098
sharidas merged 1 commit into
masterfrom
fix-sftp-issue

Conversation

@sharidas

@sharidas sharidas commented Sep 26, 2017

Copy link
Copy Markdown
Contributor

Due to removal of '\n' and '\r' from
the backendoptions the private keys were affected.
And hence resulted in failure to login. So as an
alternative in this patch we use base64_encode
and base64_decode to convert both the public and
private keys. Another advantage is that we don't
expose the private keys in the database.

Signed-off-by: Sujith H sharidasan@owncloud.com

Description

SFTP was failing to work with the change made 9b88fa6 . The key problem found was failure to authenticate with the private key.

Related Issue

#28669

Motivation and Context

The issue was caused due to the strip of value in backendoptions. And due to this the private key was modified. Hence authentication failure. This change helps users to convert public key and private key using base64_encode and retrieve the data using base64_decode.

How Has This Been Tested?

  • Enable SFTP storage
  • Select the public key option
  • Copy the public key option shown in the UI to the destination server.
  • The green light is shown in the ui
    Migration test:
    With the migration I have noticed the old data remains the same. So if new key is copied to the server using generate keys option in the UI, it works. So both the old keys work as well as the new one generated.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Due to removal of '\n' and '\r' from
the backendoptions the private keys were affected.
And hence resulted in failure to login. So as an
alternative in this patch we use base64_encode
and base64_decode to convert both the public and
private keys. Another advantage is that we don't
expose the private keys in the database.

Signed-off-by: Sujith H <sharidasan@owncloud.com>
@sharidas

sharidas commented Oct 6, 2017

Copy link
Copy Markdown
Contributor Author

Backport to stable10: #29156

@sharidas sharidas merged commit d906ba4 into master Oct 6, 2017
@DeepDiver1975 DeepDiver1975 deleted the fix-sftp-issue branch October 6, 2017 07:48
@lock

lock Bot commented Aug 2, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants