-
Notifications
You must be signed in to change notification settings - Fork 111
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is all of the code in keystore.go
copy from pss.go
or has it been changed? Is it possible to indicate where changes have been made if not, please?
swarm/pss/keystore.go
Outdated
symKeyDecryptCacheCursor int // modular cursor pointing to last used, wraps on symKeyDecryptCache array | ||
} | ||
|
||
func newKeyStore() *KeyStore { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably be loadKeyStore()
since we plan to be able to keep it across sessions. And it should probably take filename.
swarm/pss/pss.go
Outdated
log.Trace("added pubkey", "pubkeyid", pubkeyid, "topic", topic, "address", address) | ||
return nil | ||
} | ||
|
||
// Automatically generate a new symkey for a topic and address hint | ||
func (p *Pss) GenerateSymmetricKey(topic Topic, address PssAddress, addToCache bool) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this method also be in keystore?
swarm/pss/pss.go
Outdated
@@ -603,161 +562,26 @@ func (p *Pss) SetSymmetricKey(key []byte, topic Topic, address PssAddress, addto | |||
|
|||
func (p *Pss) setSymmetricKey(key []byte, topic Topic, address PssAddress, addtocache bool, protected bool) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this also in keystore?
swarm/pss/pss.go
Outdated
// Returns a symmetric key byte seqyence stored in the whisper backend | ||
// by its unique id | ||
// | ||
// Returns a symmetric key byte sequence stored in the whisper backend by its unique id | ||
// Passes on the error value from the whisper backend | ||
func (p *Pss) GetSymmetricKey(symkeyid string) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this in keystore?
swarm/pss/pss.go
Outdated
} | ||
} | ||
return | ||
return p.processSymMsg(p.w, envelope) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldnt we get the key from the store instead and decrypt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
split pss and keystore.
keystore-related code moved to a separate file.
fixes #1214