mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
whisper: symmetric encryption updated
This commit is contained in:
parent
15fc6eab07
commit
545e121f22
2 changed files with 4 additions and 2 deletions
|
|
@ -170,7 +170,7 @@ func initialize() {
|
|||
}
|
||||
|
||||
if *testMode {
|
||||
symPass = "test"
|
||||
symPass = "wwww" // ascii code: 0x77777777
|
||||
msPassword = "mail server test password"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ func (api *PublicWhisperAPI) GenerateSymKey(name string) error {
|
|||
}
|
||||
|
||||
// AddSymKey stores the key under the 'name' id.
|
||||
func (api *PublicWhisperAPI) AddSymKey(name string, key []byte) error {
|
||||
func (api *PublicWhisperAPI) AddSymKey(name string, key hexutil.Bytes) error {
|
||||
if api.whisper == nil {
|
||||
return whisperOffLineErr
|
||||
}
|
||||
|
|
@ -438,6 +438,7 @@ func (args *WhisperFilterArgs) UnmarshalJSON(b []byte) (err error) {
|
|||
|
||||
// WhisperMessage is the RPC representation of a whisper message.
|
||||
type WhisperMessage struct {
|
||||
Topic string `json:"topic"`
|
||||
Payload string `json:"payload"`
|
||||
Padding string `json:"padding"`
|
||||
From string `json:"from"`
|
||||
|
|
@ -451,6 +452,7 @@ type WhisperMessage struct {
|
|||
// NewWhisperMessage converts an internal message into an API version.
|
||||
func NewWhisperMessage(message *ReceivedMessage) *WhisperMessage {
|
||||
msg := WhisperMessage{
|
||||
Topic: common.ToHex(message.Topic[:]),
|
||||
Payload: common.ToHex(message.Payload),
|
||||
Padding: common.ToHex(message.Padding),
|
||||
Sent: message.Sent,
|
||||
|
|
|
|||
Loading…
Reference in a new issue