mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-11 06:23:47 +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 {
|
if *testMode {
|
||||||
symPass = "test"
|
symPass = "wwww" // ascii code: 0x77777777
|
||||||
msPassword = "mail server test password"
|
msPassword = "mail server test password"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ func (api *PublicWhisperAPI) GenerateSymKey(name string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddSymKey stores the key under the 'name' id.
|
// 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 {
|
if api.whisper == nil {
|
||||||
return whisperOffLineErr
|
return whisperOffLineErr
|
||||||
}
|
}
|
||||||
|
|
@ -438,6 +438,7 @@ func (args *WhisperFilterArgs) UnmarshalJSON(b []byte) (err error) {
|
||||||
|
|
||||||
// WhisperMessage is the RPC representation of a whisper message.
|
// WhisperMessage is the RPC representation of a whisper message.
|
||||||
type WhisperMessage struct {
|
type WhisperMessage struct {
|
||||||
|
Topic string `json:"topic"`
|
||||||
Payload string `json:"payload"`
|
Payload string `json:"payload"`
|
||||||
Padding string `json:"padding"`
|
Padding string `json:"padding"`
|
||||||
From string `json:"from"`
|
From string `json:"from"`
|
||||||
|
|
@ -451,6 +452,7 @@ type WhisperMessage struct {
|
||||||
// NewWhisperMessage converts an internal message into an API version.
|
// NewWhisperMessage converts an internal message into an API version.
|
||||||
func NewWhisperMessage(message *ReceivedMessage) *WhisperMessage {
|
func NewWhisperMessage(message *ReceivedMessage) *WhisperMessage {
|
||||||
msg := WhisperMessage{
|
msg := WhisperMessage{
|
||||||
|
Topic: common.ToHex(message.Topic[:]),
|
||||||
Payload: common.ToHex(message.Payload),
|
Payload: common.ToHex(message.Payload),
|
||||||
Padding: common.ToHex(message.Padding),
|
Padding: common.ToHex(message.Padding),
|
||||||
Sent: message.Sent,
|
Sent: message.Sent,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue