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

Flip some identity uses from transmission to receiption

parent d6f27a16
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,7 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader,
}
// check that the request is being sent from the proper ID
if !me.ID.Cmp(storage.GetUser().TransmissionID) {
if !me.ID.Cmp(storage.GetUser().ReceptionID) {
return errors.Errorf("Authenticated channel request " +
"can only be sent from user's identity")
}
......@@ -116,7 +116,7 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader,
jww.INFO.Printf("RequestAuth THEIRPUBKEY: %v", partner.DhPubKey.Bytes())
/*encrypt payload*/
requestFmt.SetID(storage.GetUser().TransmissionID)
requestFmt.SetID(storage.GetUser().ReceptionID)
requestFmt.SetMsgPayload(msgPayloadBytes)
ecrFmt.SetOwnership(ownership)
ecrPayload, mac := cAuth.Encrypt(newPrivKey, partner.DhPubKey,
......
......@@ -22,9 +22,9 @@ var initCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
client := createClient()
user := client.GetUser()
jww.INFO.Printf("User: %s", user.TransmissionID)
jww.INFO.Printf("User: %s", user.ReceptionID)
writeContact(user.GetContact())
fmt.Printf("%s\n", user.TransmissionID)
fmt.Printf("%s\n", user.ReceptionID)
},
}
......
......@@ -49,7 +49,7 @@ var rootCmd = &cobra.Command{
client := initClient()
user := client.GetUser()
jww.INFO.Printf("User: %s", user.TransmissionID)
jww.INFO.Printf("User: %s", user.ReceptionID)
writeContact(user.GetContact())
// Set up reception handler
......
......@@ -34,7 +34,7 @@ var udCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
client := initClient()
user := client.GetUser()
jww.INFO.Printf("User: %s", user.TransmissionID)
jww.INFO.Printf("User: %s", user.ReceptionID)
writeContact(user.GetContact())
// Set up reception handler
......
......@@ -77,7 +77,7 @@ func NewManager(session *storage.Session, switchboard *switchboard.Switchboard,
Health: health.Init(instance, params.NetworkHealthTimeout),
NodeRegistration: make(chan network.NodeGateway, params.RegNodesBufferLen),
Instance: instance,
Uid: session.User().GetCryptographicIdentity().GetReceptionID(),
Uid: session.User().GetCryptographicIdentity().GetTransmissionID(),
}
//create sub managers
......
......@@ -26,7 +26,7 @@ type addFactComms interface {
// called along with the code to finalize the fact.
func (m *Manager) SendRegisterFact(fact fact.Fact) (string, error) {
jww.INFO.Printf("ud.SendRegisterFact(%s)", fact.Stringify())
uid := m.storage.User().GetCryptographicIdentity().GetTransmissionID()
uid := m.storage.User().GetCryptographicIdentity().GetReceptionID()
return m.addFact(fact, uid, m.comms)
}
......
......@@ -92,7 +92,7 @@ func NewManager(client *api.Client) (*Manager, error) {
}
//get the commonly used data from storage
m.privKey = m.storage.GetUser().TransmissionRSA
m.privKey = m.storage.GetUser().ReceptionRSA
//load the last used commID
m.loadCommID()
......
......@@ -41,19 +41,19 @@ func (m *Manager) register(username string, comm registerUserComms) error {
// Construct the user registration message
msg := &pb.UDBUserRegistration{
PermissioningSignature: user.GetTransmissionRegistrationValidationSignature(),
RSAPublicPem: string(rsa.CreatePublicKeyPem(cryptoUser.GetTransmissionRSA().GetPublic())),
PermissioningSignature: user.GetReceptionRegistrationValidationSignature(),
RSAPublicPem: string(rsa.CreatePublicKeyPem(cryptoUser.GetReceptionRSA().GetPublic())),
IdentityRegistration: &pb.Identity{
Username: username,
DhPubKey: m.storage.E2e().GetDHPublicKey().Bytes(),
Salt: cryptoUser.GetTransmissionSalt(),
Salt: cryptoUser.GetReceptionSalt(),
},
UID: cryptoUser.GetTransmissionID().Marshal(),
UID: cryptoUser.GetReceptionID().Marshal(),
}
// Sign the identity data and add to user registration message
identityDigest := msg.IdentityRegistration.Digest()
msg.IdentitySignature, err = rsa.Sign(rng, cryptoUser.GetTransmissionRSA(),
msg.IdentitySignature, err = rsa.Sign(rng, cryptoUser.GetReceptionRSA(),
hash.CMixHash, identityDigest, nil)
if err != nil {
return errors.Errorf("Failed to sign user's IdentityRegistration: %+v", err)
......@@ -67,11 +67,11 @@ func (m *Manager) register(username string, comm registerUserComms) error {
// Hash and sign fact
hashedFact := factID.Fingerprint(usernameFact)
signedFact, err := rsa.Sign(rng, cryptoUser.GetTransmissionRSA(), hash.CMixHash, hashedFact, nil)
signedFact, err := rsa.Sign(rng, cryptoUser.GetReceptionRSA(), hash.CMixHash, hashedFact, nil)
// Add username fact register request to the user registration message
msg.Frs = &pb.FactRegisterRequest{
UID: cryptoUser.GetTransmissionID().Marshal(),
UID: cryptoUser.GetReceptionID().Marshal(),
Fact: &pb.Fact{
Fact: username,
FactType: 0,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment