Skip to content
Snippets Groups Projects
Commit 949f3492 authored by Jonah Husson's avatar Jonah Husson
Browse files

Fix user copy & notification permissioning signature verification

parent 8a6a4754
No related branches found
No related tags found
1 merge request!23Release
......@@ -40,7 +40,7 @@ func (c *Client) RegisterForNotifications(token string) error {
&mixmessages.NotificationRegisterRequest{
Token: token,
IntermediaryId: intermediaryReceptionID,
TransmissionRsa: rsa.CreatePublicKeyPem(c.GetUser().TransmissionRSA.GetPublic()),
TransmissionRsa: rsa.CreatePublicKeyPem(c.GetStorage().User().GetCryptographicIdentity().GetTransmissionRSA().GetPublic()),
TransmissionSalt: c.GetUser().TransmissionSalt,
TransmissionRsaSig: c.GetStorage().User().GetTransmissionRegistrationValidationSignature(),
IIDTransmissionRsaSig: sig,
......@@ -95,7 +95,8 @@ func (c *Client) getIidAndSig() ([]byte, []byte, error) {
}
stream := c.rng.GetStream()
sig, err := rsa.Sign(stream, c.GetUser().TransmissionRSA, hash.CMixHash, h.Sum(nil), nil)
c.GetUser()
sig, err := rsa.Sign(stream, c.storage.User().GetCryptographicIdentity().GetTransmissionRSA(), hash.CMixHash, h.Sum(nil), nil)
if err != nil {
return nil, nil, errors.WithMessage(err, "RegisterForNotifications: Failed to sign intermediary ID")
}
......
......@@ -116,7 +116,7 @@ var rootCmd = &cobra.Command{
client.GetHealth().AddChannel(connected)
waitUntilConnected(connected)
//err = client.RegisterForNotifications([]byte("dJwuGGX3KUyKldWK5PgQH8:APA91bFjuvimRc4LqOyMDiy124aLedifA8DhldtaB_b76ggphnFYQWJc_fq0hzQ-Jk4iYp2wPpkwlpE1fsOjs7XWBexWcNZoU-zgMiM0Mso9vTN53RhbXUferCbAiEylucEOacy9pniN"))
//err = client.RegisterForNotifications("dJwuGGX3KUyKldWK5PgQH8:APA91bFjuvimRc4LqOyMDiy124aLedifA8DhldtaB_b76ggphnFYQWJc_fq0hzQ-Jk4iYp2wPpkwlpE1fsOjs7XWBexWcNZoU-zgMiM0Mso9vTN53RhbXUferCbAiEylucEOacy9pniN")
//if err != nil {
// jww.FATAL.Panicf("Failed to register for notifications: %+v", err)
//}
......
......@@ -23,7 +23,7 @@ require (
gitlab.com/elixxir/primitives v0.0.3-0.20210427004615-c68ecf15fcf3
gitlab.com/xx_network/comms v0.0.4-0.20210409202820-eb3dca6571d3
gitlab.com/xx_network/crypto v0.0.5-0.20210405224157-2b1f387b42c1
gitlab.com/xx_network/primitives v0.0.4-0.20210402222416-37c1c4d3fac4
gitlab.com/xx_network/primitives v0.0.4-0.20210419175212-11b843dd4791
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 // indirect
google.golang.org/genproto v0.0.0-20210105202744-fe13368bc0e1 // indirect
......
......@@ -27,7 +27,6 @@ type registrationMessageSender interface {
// Returns an error if registration fails.
func register(comms registrationMessageSender, host *connect.Host,
transmissionPublicKey, receptionPublicKey *rsa.PublicKey, registrationCode string) ([]byte, []byte, error) {
response, err := comms.
SendRegistrationMessage(host,
&pb.UserRegistration{
......@@ -35,8 +34,9 @@ func register(comms registrationMessageSender, host *connect.Host,
ClientRSAPubKey: string(rsa.CreatePublicKeyPem(transmissionPublicKey)),
ClientReceptionRSAPubKey: string(rsa.CreatePublicKeyPem(receptionPublicKey)),
})
if err != nil {
err = errors.Wrap(err, "sendRegistrationMessage: Unable to contact Identity Server!")
err = errors.WithMessage(err, "sendRegistrationMessage: Unable to contact Identity Server!")
return nil, nil, err
}
if response.Error != "" {
......
......@@ -16,7 +16,7 @@ func (s *Session) GetUser() user.User {
return user.User{
TransmissionID: ci.GetTransmissionID().DeepCopy(),
TransmissionSalt: copySlice(ci.GetTransmissionSalt()),
TransmissionRSA: ci.GetReceptionRSA(),
TransmissionRSA: ci.GetTransmissionRSA(),
ReceptionID: ci.GetReceptionID().DeepCopy(),
ReceptionSalt: copySlice(ci.GetReceptionSalt()),
ReceptionRSA: ci.GetReceptionRSA(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment