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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
ee10508c
Commit
ee10508c
authored
2 years ago
by
Richard T. Carback III
Browse files
Options
Downloads
Patches
Plain Diff
remove prcan stuff from auth
parent
bc53672a
No related branches found
No related tags found
2 merge requests
!510
Release
,
!207
WIP: Client Restructure
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/auth.go
+0
-66
0 additions, 66 deletions
api/auth.go
with
0 additions
and
66 deletions
api/auth.go
+
0
−
66
View file @
ee10508c
...
...
@@ -8,18 +8,12 @@
package
api
import
(
"encoding/binary"
"gitlab.com/elixxir/client/e2e/ratchet/partner"
"math/rand"
"github.com/cloudflare/circl/dh/sidh"
"github.com/pkg/errors"
jww
"github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/auth"
"gitlab.com/elixxir/client/e2e/ratchet/partner/session"
util
"gitlab.com/elixxir/client/storage/utility"
"gitlab.com/elixxir/crypto/contact"
"gitlab.com/elixxir/primitives/fact"
"gitlab.com/xx_network/primitives/id"
)
...
...
@@ -106,66 +100,6 @@ func (c *Client) HasAuthenticatedChannel(partner *id.ID) bool {
return
m
!=
nil
&&
err
==
nil
}
// Create an insecure e2e relationship with a precanned user
func
(
c
*
Client
)
MakePrecannedAuthenticatedChannel
(
precannedID
uint
)
(
contact
.
Contact
,
error
)
{
precan
:=
c
.
MakePrecannedContact
(
precannedID
)
myID
:=
binary
.
BigEndian
.
Uint64
(
c
.
GetUser
()
.
GetContact
()
.
ID
[
:
])
// Pick a variant based on if their ID is bigger than mine.
myVariant
:=
sidh
.
KeyVariantSidhA
theirVariant
:=
sidh
.
KeyVariant
(
sidh
.
KeyVariantSidhB
)
if
myID
>
uint64
(
precannedID
)
{
myVariant
=
sidh
.
KeyVariantSidhB
theirVariant
=
sidh
.
KeyVariantSidhA
}
prng1
:=
rand
.
New
(
rand
.
NewSource
(
int64
(
precannedID
)))
theirSIDHPrivKey
:=
util
.
NewSIDHPrivateKey
(
theirVariant
)
theirSIDHPubKey
:=
util
.
NewSIDHPublicKey
(
theirVariant
)
theirSIDHPrivKey
.
Generate
(
prng1
)
theirSIDHPrivKey
.
GeneratePublicKey
(
theirSIDHPubKey
)
prng2
:=
rand
.
New
(
rand
.
NewSource
(
int64
(
myID
)))
mySIDHPrivKey
:=
util
.
NewSIDHPrivateKey
(
myVariant
)
mySIDHPubKey
:=
util
.
NewSIDHPublicKey
(
myVariant
)
mySIDHPrivKey
.
Generate
(
prng2
)
mySIDHPrivKey
.
GeneratePublicKey
(
mySIDHPubKey
)
// add the precanned user as a e2e contact
// FIXME: these params need to be threaded through...
sesParam
:=
session
.
GetDefaultParams
()
_
,
err
:=
c
.
e2e
.
AddPartner
(
precan
.
ID
,
precan
.
DhPubKey
,
c
.
e2e
.
GetHistoricalDHPrivkey
(),
theirSIDHPubKey
,
mySIDHPrivKey
,
sesParam
,
sesParam
)
// check garbled messages in case any messages arrived before creating
// the channel
c
.
network
.
CheckInProgressMessages
()
return
precan
,
err
}
// Create an insecure e2e contact object for a precanned user
func
(
c
*
Client
)
MakePrecannedContact
(
precannedID
uint
)
contact
.
Contact
{
e2eGrp
:=
c
.
storage
.
GetE2EGroup
()
precanned
:=
createPrecannedUser
(
precannedID
,
c
.
rng
.
GetStream
(),
c
.
storage
.
GetCmixGroup
(),
e2eGrp
)
// compute their public e2e key
partnerPubKey
:=
e2eGrp
.
ExpG
(
precanned
.
E2eDhPrivateKey
,
e2eGrp
.
NewInt
(
1
))
return
contact
.
Contact
{
ID
:
precanned
.
ReceptionID
,
DhPubKey
:
partnerPubKey
,
OwnershipProof
:
nil
,
Facts
:
make
([]
fact
.
Fact
,
0
),
}
}
// GetRelationshipFingerprint returns a unique 15 character fingerprint for an
// E2E relationship. An error is returned if no relationship with the partner
// is found.
...
...
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