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
I
irmago
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
IRMA
Github mirrors
irmago
Commits
ad607bd1
Commit
ad607bd1
authored
Jan 22, 2020
by
Sietse Ringers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: private key handling
parent
dda57c4d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
3 deletions
+32
-3
irmaconfig.go
irmaconfig.go
+30
-2
revocation_db.go
revocation_db.go
+1
-0
server/conf.go
server/conf.go
+1
-1
No files found.
irmaconfig.go
View file @
ad607bd1
...
...
@@ -532,8 +532,36 @@ func (conf *Configuration) parseKeysFolder(issuerid IssuerIdentifier) error {
return
nil
}
func
sorter
(
ints
[]
uint
)
func
(
i
,
j
int
)
bool
{
return
func
(
i
,
j
int
)
bool
{
return
ints
[
i
]
<
ints
[
j
]
}
}
// unionset returns the concatenation of a and b, without duplicates, and sorted.
func
unionset
(
a
,
b
[]
uint
)
[]
uint
{
m
:=
map
[
uint
]
struct
{}{}
for
_
,
c
:=
range
[][]
uint
{
a
,
b
}
{
for
_
,
i
:=
range
c
{
m
[
i
]
=
struct
{}{}
}
}
var
ints
[]
uint
for
i
:=
range
m
{
ints
=
append
(
ints
,
i
)
}
sort
.
Slice
(
ints
,
sorter
(
ints
))
return
ints
}
func
(
conf
*
Configuration
)
PrivateKeyIndices
(
issuerid
IssuerIdentifier
)
(
i
[]
uint
,
err
error
)
{
return
conf
.
matchKeyPattern
(
issuerid
,
privkeyPattern
)
filekeys
,
err
:=
conf
.
matchKeyPattern
(
issuerid
,
privkeyPattern
)
if
err
!=
nil
{
return
nil
,
err
}
var
mapkeys
[]
uint
for
_
,
sk
:=
range
conf
.
PrivateKeys
[
issuerid
]
{
mapkeys
=
append
(
mapkeys
,
sk
.
Counter
)
}
return
unionset
(
filekeys
,
mapkeys
),
nil
}
func
(
conf
*
Configuration
)
PublicKeyIndices
(
issuerid
IssuerIdentifier
)
(
i
[]
uint
,
err
error
)
{
...
...
@@ -554,7 +582,7 @@ func (conf *Configuration) matchKeyPattern(issuerid IssuerIdentifier, pattern st
}
ints
=
append
(
ints
,
uint
(
count
))
}
sort
.
Slice
(
ints
,
func
(
i
,
j
int
)
bool
{
return
ints
[
i
]
<
ints
[
j
]
}
)
sort
.
Slice
(
ints
,
sorter
(
ints
)
)
return
}
...
...
revocation_db.go
View file @
ad607bd1
...
...
@@ -78,6 +78,7 @@ func newSqlStorage(debug bool, dbtype, connstr string) (revStorage, error) {
}
func
(
s
sqlRevStorage
)
Close
()
error
{
Logger
.
Debug
(
"closing revocation sql database connection"
)
return
s
.
gorm
.
Close
()
}
...
...
server/conf.go
View file @
ad607bd1
...
...
@@ -251,7 +251,7 @@ func (conf *Configuration) prepareRevocation(credid irma.CredentialTypeIdentifie
if
!
exists
{
conf
.
Logger
.
Warnf
(
"Creating initial accumulator for %s-%d"
,
credid
,
skcounter
)
if
err
:=
conf
.
IrmaConfiguration
.
Revocation
.
EnableRevocation
(
credid
,
sk
);
err
!=
nil
{
return
LogError
(
errors
.
WrapPrefix
(
err
,
"failed to create initial accumulator record for "
+
credid
.
String
(
),
0
))
return
LogError
(
errors
.
WrapPrefix
(
err
,
fmt
.
Sprintf
(
"failed create initial accumulator for %s-%d"
,
credid
,
skcounter
),
0
))
}
}
}
...
...
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