summaryrefslogtreecommitdiff
path: root/dryad/rusalka.go
diff options
context:
space:
mode:
authorMaciej Wereski <m.wereski@partner.samsung.com>2018-08-07 16:04:09 +0200
committerMaciej Wereski <m.wereski@partner.samsung.com>2018-08-09 11:28:39 +0200
commite50de051fc526e2d68698fd3abd39725a72bd7f8 (patch)
treed44a1324ae367749529525825d066f6b064877a6 /dryad/rusalka.go
parent2a8a63489b6435f0e4970176472a509170719f9c (diff)
downloadboruta-e50de051fc526e2d68698fd3abd39725a72bd7f8.tar.gz
boruta-e50de051fc526e2d68698fd3abd39725a72bd7f8.tar.bz2
boruta-e50de051fc526e2d68698fd3abd39725a72bd7f8.zip
Change rsa.PublicKey to ssh.PublicKey in Dryad Prepare
Users will use SSH keys rather than plain RSA keys, so Dryad interface should accept SSH public key instead of generating it from RSA public key. Change-Id: I6e757199a7e8a0d3258c1c17ac0eee8412f2b415 Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
Diffstat (limited to 'dryad/rusalka.go')
-rw-r--r--dryad/rusalka.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/dryad/rusalka.go b/dryad/rusalka.go
index 7549308..e4af51c 100644
--- a/dryad/rusalka.go
+++ b/dryad/rusalka.go
@@ -21,7 +21,6 @@ package dryad
import (
"context"
- "crypto/rsa"
"fmt"
. "git.tizen.org/tools/boruta"
@@ -62,7 +61,7 @@ func (r *Rusalka) PutInMaintenance(msg string) error {
}
// Prepare is part of implementation of Dryad interface. Call to Prepare stops LED blinking.
-func (r *Rusalka) Prepare(key *rsa.PublicKey) (err error) {
+func (r *Rusalka) Prepare(key *ssh.PublicKey) (err error) {
// Stop maintenance.
if r.cancelMaintenance != nil {
r.cancelMaintenance()
@@ -82,10 +81,7 @@ func (r *Rusalka) Prepare(key *rsa.PublicKey) (err error) {
if err != nil {
return fmt.Errorf("user information update failed: %s", err)
}
- // Prepare SSH access (it can't fail as key is of type rsa.PublicKey).
- sshPubKey, _ := ssh.NewPublicKey(key)
- // TODO: use ssh.PublicKey instead.
- return r.dryadUser.generateAndInstallKey(sshPubKey)
+ return r.dryadUser.installKey(key)
}
// Healthcheck is part of implementation of Dryad interface.