Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
authority
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
katzenpost
authority
Commits
dc7bac01
Unverified
Commit
dc7bac01
authored
Feb 23, 2019
by
Sofía Celi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix lint
parent
846328a7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
21 deletions
+21
-21
internal/s11n/descriptor.go
internal/s11n/descriptor.go
+2
-1
internal/s11n/document_test.go
internal/s11n/document_test.go
+7
-8
nonvoting/server/server.go
nonvoting/server/server.go
+1
-1
tests/voting_authority_test.go
tests/voting_authority_test.go
+2
-2
voting/client/client.go
voting/client/client.go
+3
-3
voting/server/server.go
voting/server/server.go
+1
-1
voting/server/state.go
voting/server/state.go
+5
-5
No files found.
internal/s11n/descriptor.go
View file @
dc7bac01
...
...
@@ -25,8 +25,8 @@ import (
"time"
"github.com/katzenpost/core/crypto/cert"
"github.com/katzenpost/core/pki"
"github.com/katzenpost/core/epochtime"
"github.com/katzenpost/core/pki"
"github.com/katzenpost/core/sphinx/constants"
"github.com/ugorji/go/codec"
"golang.org/x/net/idna"
...
...
@@ -35,6 +35,7 @@ import (
const
(
nodeDescriptorVersion
=
"v0"
)
var
(
// CertificateExpiration is the time a descriptor certificate will be valid for.
CertificateExpiration
=
(
epochtime
.
Period
*
3
)
+
(
time
.
Minute
*
10
)
...
...
internal/s11n/document_test.go
View file @
dc7bac01
...
...
@@ -77,16 +77,15 @@ func TestDocument(t *testing.T) {
sharedRandomCommit
:=
make
([]
byte
,
SharedRandomLength
)
binary
.
BigEndian
.
PutUint64
(
sharedRandomCommit
[
:
8
],
debugTestEpoch
)
// Generate a Document.
doc
:=
&
Document
{
Epoch
:
debugTestEpoch
,
SendRatePerMinute
:
testSendRate
,
Topology
:
make
([][][]
byte
,
3
),
MixLambda
:
0.42
,
MixMaxDelay
:
23
,
SendLambda
:
0.69
,
SendMaxInterval
:
17
,
Epoch
:
debugTestEpoch
,
SendRatePerMinute
:
testSendRate
,
Topology
:
make
([][][]
byte
,
3
),
MixLambda
:
0.42
,
MixMaxDelay
:
23
,
SendLambda
:
0.69
,
SendMaxInterval
:
17
,
SharedRandomCommit
:
sharedRandomCommit
,
SharedRandomValue
:
make
([]
byte
,
SharedRandomValueLength
),
}
...
...
nonvoting/server/server.go
View file @
dc7bac01
...
...
@@ -113,7 +113,7 @@ func (s *Server) IdentityKey() *eddsa.PublicKey {
func
(
s
*
Server
)
RotateLog
()
{
err
:=
s
.
logBackend
.
Rotate
()
if
err
!=
nil
{
s
.
fatalErrCh
<-
fmt
.
Errorf
(
"
Failed to rotate log file, shutting down server.
"
)
s
.
fatalErrCh
<-
fmt
.
Errorf
(
"
failed to rotate log file, shutting down server
"
)
}
s
.
log
.
Notice
(
"Log rotated."
)
}
...
...
tests/voting_authority_test.go
View file @
dc7bac01
...
...
@@ -135,7 +135,7 @@ func (s *kimchi) genGoodVotingAuthoritiesCfg(numAuthorities int) error {
Addresses
:
[]
string
{
fmt
.
Sprintf
(
"127.0.0.1:%d"
,
s
.
lastPort
)},
DataDir
:
filepath
.
Join
(
s
.
baseDir
,
fmt
.
Sprintf
(
"authority%d"
,
i
)),
}
s
.
lastPort
+=
1
s
.
lastPort
++
privateIdentityKey
,
err
:=
eddsa
.
NewKeypair
(
rand
.
Reader
)
if
err
!=
nil
{
return
err
...
...
@@ -188,7 +188,7 @@ func (s *kimchi) genBadVotingAuthoritiesCfg(numAuthorities int) error {
Addresses
:
[]
string
{
fmt
.
Sprintf
(
"127.0.0.1:%d"
,
s
.
lastPort
)},
DataDir
:
filepath
.
Join
(
s
.
baseDir
,
fmt
.
Sprintf
(
"authority%d"
,
i
)),
}
s
.
lastPort
+=
1
s
.
lastPort
++
privateIdentityKey
,
err
:=
eddsa
.
NewKeypair
(
rand
.
Reader
)
if
err
!=
nil
{
return
err
...
...
voting/client/client.go
View file @
dc7bac01
...
...
@@ -226,9 +226,9 @@ func (p *connector) randomPeerRoundTrip(ctx context.Context, linkKey *ecdh.Priva
// Client is a PKI client.
type
Client
struct
{
cfg
*
Config
log
*
logging
.
Logger
pool
*
connector
cfg
*
Config
log
*
logging
.
Logger
pool
*
connector
verifiers
[]
cert
.
Verifier
threshold
int
}
...
...
voting/server/server.go
View file @
dc7bac01
...
...
@@ -109,7 +109,7 @@ func (s *Server) IdentityKey() *eddsa.PublicKey {
func
(
s
*
Server
)
RotateLog
()
{
err
:=
s
.
logBackend
.
Rotate
()
if
err
!=
nil
{
s
.
fatalErrCh
<-
fmt
.
Errorf
(
"
Failed to rotate log file, shutting down server.
"
)
s
.
fatalErrCh
<-
fmt
.
Errorf
(
"
failed to rotate log file, shutting down server
"
)
}
s
.
log
.
Notice
(
"Log rotated."
)
}
...
...
voting/server/state.go
View file @
dc7bac01
...
...
@@ -628,10 +628,10 @@ func (s *state) tallyVotes(epoch uint64) ([]*descriptor, *config.Parameters, err
// Lock is held (called from the onWakeup hook).
_
,
ok
:=
s
.
votes
[
epoch
]
if
!
ok
{
return
nil
,
nil
,
fmt
.
Errorf
(
"
No votes for epoch %v!
"
,
epoch
)
return
nil
,
nil
,
fmt
.
Errorf
(
"
no votes for epoch %v
"
,
epoch
)
}
if
len
(
s
.
votes
[
epoch
])
<=
s
.
threshold
{
return
nil
,
nil
,
fmt
.
Errorf
(
"
Not enough votes for epoch %v!
"
,
epoch
)
return
nil
,
nil
,
fmt
.
Errorf
(
"
not enough votes for epoch %v
"
,
epoch
)
}
nodes
:=
make
([]
*
descriptor
,
0
)
...
...
@@ -735,11 +735,11 @@ func (s *state) tallyVotes(epoch uint64) ([]*descriptor, *config.Parameters, err
return
nodes
,
params
,
nil
}
}
else
if
len
(
votes
)
>=
s
.
dissenters
{
return
nil
,
nil
,
errors
.
New
(
"
Consensus partition?!
"
)
return
nil
,
nil
,
errors
.
New
(
"
a consensus partition
"
)
}
}
return
nil
,
nil
,
errors
.
New
(
"
Consensus failure!
"
)
return
nil
,
nil
,
errors
.
New
(
"
consensus failure
"
)
}
func
(
s
*
state
)
GetConsensus
(
epoch
uint64
)
(
*
document
,
error
)
{
...
...
@@ -1487,6 +1487,6 @@ func sortNodesByPublicKey(nodes []*descriptor) {
}
func
sha256b64
(
raw
[]
byte
)
string
{
var
hash
[
32
]
byte
=
sha3
.
Sum256
(
raw
)
var
hash
=
sha3
.
Sum256
(
raw
)
return
base64
.
StdEncoding
.
EncodeToString
(
hash
[
:
])
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment