mirror of
https://github.com/rwinkhart/rcw.git
synced 2026-10-29 06:58:15 -04:00
Implement serving passphrase from daemon
This commit is contained in:
1 parent
a5108bc6cc
commit
dc262c87e8
5 files changed
+35
-15
No files matched your search
+3
-6
@@ -2,12 +2,12 @@ package daemon
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"errors"
|
||||
"io"
|
||||
"os"
|
||||
)
|
||||
|
||||
var daemonHash []byte
|
||||
var passphrase string
|
||||
|
||||
// RCWService provides an RPC method.
|
||||
type RCWService struct{}
|
||||
@@ -15,11 +15,8 @@ type RCWService struct{}
|
||||
// GetPass is the RPC method.
|
||||
// For now (as a test/example), it returns "hello" if the input is "hi".
|
||||
func (h *RCWService) GetPass(request string, reply *string) error {
|
||||
if request == "hi" {
|
||||
*reply = "hello"
|
||||
return nil
|
||||
}
|
||||
return errors.New("unexpected input, expected \"hi\"")
|
||||
*reply = passphrase
|
||||
return nil
|
||||
}
|
||||
|
||||
// getFileHash returns the SHA256 hash of the file at the given path.
|
||||
|
||||
Reference in new issue
Block a user