Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
2eca2ee4
Commit
2eca2ee4
authored
Nov 16, 2020
by
Sydney Anne Erickson
Browse files
Options
Downloads
Patches
Plain Diff
Fix SendDeleteMessage
parent
93882e4d
No related branches found
No related tags found
No related merge requests found
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
Makefile
+3
-3
3 additions, 3 deletions
Makefile
go.mod
+4
-4
4 additions, 4 deletions
go.mod
go.sum
+11
-47
11 additions, 47 deletions
go.sum
ud/remove.go
+2
-35
2 additions, 35 deletions
ud/remove.go
ud/remove_test.go
+2
-1
2 additions, 1 deletion
ud/remove_test.go
with
22 additions
and
90 deletions
Makefile
+
3
−
3
View file @
2eca2ee4
...
@@ -20,10 +20,10 @@ build:
...
@@ -20,10 +20,10 @@ build:
go mod tidy
go mod tidy
update_release
:
update_release
:
GOFLAGS
=
""
go get
-u
gitlab.com/elixxir/primitives@
peppa/newClient
GOFLAGS
=
""
go get
-u
gitlab.com/elixxir/primitives@
release
GOFLAGS
=
""
go get
-u
gitlab.com/elixxir/crypto@
peppa/newClient
GOFLAGS
=
""
go get
-u
gitlab.com/elixxir/crypto@
release
GOFLAGS
=
""
go get
-u
gitlab.com/xx_network/crypto@release
GOFLAGS
=
""
go get
-u
gitlab.com/xx_network/crypto@release
GOFLAGS
=
""
go get
-u
gitlab.com/elixxir/comms@
hotfix/TestingFunction
GOFLAGS
=
""
go get
-u
gitlab.com/elixxir/comms@
"Anne/FactCommsHotfix"
GOFLAGS
=
""
go get
-u
gitlab.com/xx_network/comms@release
GOFLAGS
=
""
go get
-u
gitlab.com/xx_network/comms@release
GOFLAGS
=
""
go get
-u
gitlab.com/xx_network/primitives@release
GOFLAGS
=
""
go get
-u
gitlab.com/xx_network/primitives@release
...
...
This diff is collapsed.
Click to expand it.
go.mod
+
4
−
4
View file @
2eca2ee4
...
@@ -17,11 +17,11 @@ require (
...
@@ -17,11 +17,11 @@ require (
github.com/spf13/jwalterweatherman
v1.1.0
github.com/spf13/jwalterweatherman
v1.1.0
github.com/spf13/pflag
v1.0.5 // indirect
github.com/spf13/pflag
v1.0.5 // indirect
github.com/spf13/viper
v1.7.1
github.com/spf13/viper
v1.7.1
gitlab.com/elixxir/comms
v0.0.4-0.202011
03220934-c476c9282f30
gitlab.com/elixxir/comms
v0.0.4-0.202011
16215317-0febe6765554
gitlab.com/elixxir/crypto
v0.0.5-0.202011
09203841-ba162a25be6e
gitlab.com/elixxir/crypto
v0.0.5-0.202011
10193609-6b5e881867b4
gitlab.com/elixxir/ekv
v0.1.3
gitlab.com/elixxir/ekv
v0.1.3
gitlab.com/elixxir/primitives
v0.0.
2
gitlab.com/elixxir/primitives
v0.0.
3-0.20201116174806-97f190989704
gitlab.com/xx_network/comms
v0.0.
3
gitlab.com/xx_network/comms
v0.0.
4-0.20201110022115-4a6171cad07d
gitlab.com/xx_network/crypto
v0.0.4
gitlab.com/xx_network/crypto
v0.0.4
gitlab.com/xx_network/primitives
v0.0.2
gitlab.com/xx_network/primitives
v0.0.2
golang.org/x/crypto
v0.0.0-20201016220609-9e8e0b390897
golang.org/x/crypto
v0.0.0-20201016220609-9e8e0b390897
...
...
This diff is collapsed.
Click to expand it.
go.sum
+
11
−
47
View file @
2eca2ee4
This diff is collapsed.
Click to expand it.
ud/remove.go
+
2
−
35
View file @
2eca2ee4
package
ud
package
ud
import
(
import
(
"crypto/rand"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes/any"
"gitlab.com/elixxir/client/interfaces/contact"
"gitlab.com/elixxir/client/interfaces/contact"
"gitlab.com/elixxir/comms/mixmessages"
"gitlab.com/elixxir/comms/mixmessages"
"gitlab.com/elixxir/crypto/hash"
"gitlab.com/xx_network/comms/connect"
"gitlab.com/xx_network/comms/connect"
"gitlab.com/xx_network/comms/messages"
"gitlab.com/xx_network/comms/messages"
"gitlab.com/xx_network/crypto/signature/rsa"
)
)
type
removeFactComms
interface
{
type
removeFactComms
interface
{
SendDeleteMessage
(
host
*
connect
.
Host
,
message
*
messages
.
AuthenticatedMessage
)
(
*
messages
.
Ack
,
error
)
SendDeleteMessage
(
host
*
connect
.
Host
,
message
*
mix
messages
.
FactRemovalRequest
)
(
*
messages
.
Ack
,
error
)
}
}
func
(
m
*
Manager
)
RemoveFact
(
fact
contact
.
Fact
)
error
{
func
(
m
*
Manager
)
RemoveFact
(
fact
contact
.
Fact
)
error
{
...
@@ -28,42 +23,14 @@ func (m *Manager) removeFact(fact contact.Fact, rFC removeFactComms) error {
...
@@ -28,42 +23,14 @@ func (m *Manager) removeFact(fact contact.Fact, rFC removeFactComms) error {
FactType
:
uint32
(
fact
.
T
),
FactType
:
uint32
(
fact
.
T
),
}
}
// Sign the fact
signedFact
,
err
:=
rsa
.
Sign
(
rand
.
Reader
,
m
.
privKey
,
hash
.
CMixHash
,
mmFact
.
Digest
(),
rsa
.
NewDefaultOptions
())
if
err
!=
nil
{
return
err
}
// Create our Fact Removal Request message data
// Create our Fact Removal Request message data
remFactMsg
:=
mixmessages
.
FactRemovalRequest
{
remFactMsg
:=
mixmessages
.
FactRemovalRequest
{
UID
:
m
.
host
.
GetId
()
.
Marshal
(),
UID
:
m
.
host
.
GetId
()
.
Marshal
(),
RemovalData
:
&
mmFact
,
RemovalData
:
&
mmFact
,
}
}
// Marshal it to bytes for sending over the wire
remFactMsgMarshalled
,
err
:=
proto
.
Marshal
(
&
remFactMsg
)
if
err
!=
nil
{
return
err
}
// Convert our marshalled Fact Removal Request to an Any
// object for sending in an authed message
remFactMsgAny
:=
any
.
Any
{
TypeUrl
:
"gitlab.com/elixxir/client/interfaces/contact.Fact"
,
Value
:
remFactMsgMarshalled
,
}
// Create our AuthenticatedMessage so we can send the data over
msg
:=
messages
.
AuthenticatedMessage
{
ID
:
nil
,
Signature
:
signedFact
,
Token
:
nil
,
Client
:
nil
,
Message
:
&
remFactMsgAny
,
}
// Send the message
// Send the message
_
,
err
=
rFC
.
SendDeleteMessage
(
m
.
host
,
&
m
sg
)
_
,
err
:
=
rFC
.
SendDeleteMessage
(
m
.
host
,
&
remFactM
sg
)
// Return the error
// Return the error
return
err
return
err
...
...
This diff is collapsed.
Click to expand it.
ud/remove_test.go
+
2
−
1
View file @
2eca2ee4
...
@@ -3,6 +3,7 @@ package ud
...
@@ -3,6 +3,7 @@ package ud
import
(
import
(
"gitlab.com/elixxir/client/interfaces/contact"
"gitlab.com/elixxir/client/interfaces/contact"
"gitlab.com/elixxir/comms/client"
"gitlab.com/elixxir/comms/client"
pb
"gitlab.com/elixxir/comms/mixmessages"
"gitlab.com/elixxir/crypto/cyclic"
"gitlab.com/elixxir/crypto/cyclic"
"gitlab.com/xx_network/comms/connect"
"gitlab.com/xx_network/comms/connect"
"gitlab.com/xx_network/comms/messages"
"gitlab.com/xx_network/comms/messages"
...
@@ -33,7 +34,7 @@ var genericGroup = cyclic.NewGroup(
...
@@ -33,7 +34,7 @@ var genericGroup = cyclic.NewGroup(
type
testRFC
struct
{}
type
testRFC
struct
{}
func
(
rFC
*
testRFC
)
SendDeleteMessage
(
host
*
connect
.
Host
,
message
*
messages
.
AuthenticatedMessage
)
(
*
messages
.
Ack
,
error
)
{
func
(
rFC
*
testRFC
)
SendDeleteMessage
(
host
*
connect
.
Host
,
message
*
pb
.
FactRemovalRequest
)
(
*
messages
.
Ack
,
error
)
{
return
&
messages
.
Ack
{},
nil
return
&
messages
.
Ack
{},
nil
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment