diff options
author | Maciej Wereski <m.wereski@partner.samsung.com> | 2018-08-07 16:04:09 +0200 |
---|---|---|
committer | Maciej Wereski <m.wereski@partner.samsung.com> | 2018-08-09 11:28:39 +0200 |
commit | e50de051fc526e2d68698fd3abd39725a72bd7f8 (patch) | |
tree | d44a1324ae367749529525825d066f6b064877a6 /dryad/rusalka_test.go | |
parent | 2a8a63489b6435f0e4970176472a509170719f9c (diff) | |
download | boruta-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_test.go')
-rw-r--r-- | dryad/rusalka_test.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/dryad/rusalka_test.go b/dryad/rusalka_test.go index f3799af..69136ed 100644 --- a/dryad/rusalka_test.go +++ b/dryad/rusalka_test.go @@ -23,6 +23,7 @@ import ( "crypto/rsa" "crypto/x509" "encoding/pem" + "errors" "os" "os/user" "time" @@ -32,6 +33,7 @@ import ( gomock "github.com/golang/mock/gomock" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "golang.org/x/crypto/ssh" ) var _ = Describe("Rusalka", func() { @@ -84,9 +86,13 @@ var _ = Describe("Rusalka", func() { Skip("must be run as root") } + err = d.Prepare(nil) + Expect(err).To(Equal(errors.New("empty public key"))) key, err := rsa.GenerateKey(rand.Reader, 1024) Expect(err).ToNot(HaveOccurred()) - err = d.Prepare(&key.PublicKey) + pubKey, err := ssh.NewPublicKey(&key.PublicKey) + Expect(err).ToNot(HaveOccurred()) + err = d.Prepare(&pubKey) Expect(err).ToNot(HaveOccurred()) Expect(sshDir).To(BeADirectory()) Expect(authorizedKeysFile).To(BeARegularFile()) |