Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irmago
Commits
1e5db54d
Unverified
Commit
1e5db54d
authored
Dec 15, 2017
by
Sietse Ringers
Committed by
GitHub
Dec 15, 2017
Browse files
Merge pull request #3 from bwesterb/master
Kleine aanpassingen nodig voor irma-watchdogd
parents
d2f901ef
58c50888
Changes
2
Hide whitespace changes
Inline
Side-by-side
irmaconfig.go
View file @
1e5db54d
...
...
@@ -615,7 +615,7 @@ func (i SchemeManagerIndex) FromString(s string) error {
func
(
conf
*
Configuration
)
parseIndex
(
name
string
,
manager
*
SchemeManager
)
error
{
path
:=
filepath
.
Join
(
conf
.
path
,
name
,
"index"
)
if
err
:=
fs
.
AssertPathExists
(
path
);
err
!=
nil
{
return
errors
.
New
(
"Missing scheme manager index file
"
)
return
fmt
.
Errorf
(
"Missing scheme manager index file
; tried %s"
,
path
)
}
indexbts
,
err
:=
ioutil
.
ReadFile
(
path
)
if
err
!=
nil
{
...
...
schememgr/cmd/verify.go
View file @
1e5db54d
...
...
@@ -17,35 +17,41 @@ var verifyCmd = &cobra.Command{
Long
:
`The verify command parses the specified irma_configuration folder and checks the signatures of the contained scheme managers.`
,
Args
:
cobra
.
ExactArgs
(
1
),
RunE
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
path
,
err
:=
filepath
.
Abs
(
args
[
0
])
if
err
!=
nil
{
return
err
}
if
filepath
.
Base
(
path
)
!=
"irma_configuration"
{
return
errors
.
New
(
"Path is not irma_configuration"
)
}
conf
,
err
:=
irma
.
NewConfiguration
(
path
,
""
)
if
err
!=
nil
{
return
err
}
if
err
:=
conf
.
ParseFolder
();
err
!=
nil
{
return
err
err
:=
RunVerify
(
args
[
0
])
if
err
==
nil
{
fmt
.
Println
()
fmt
.
Println
(
"irma_configuration parsed and authenticated successfully."
)
}
return
err
},
}
for
_
,
manager
:=
range
conf
.
SchemeManagers
{
for
file
:=
range
manager
.
Index
{
// Don't care about the actual bytes
if
_
,
err
:=
conf
.
ReadAuthenticatedFile
(
manager
,
file
);
err
!=
nil
{
return
err
}
func
RunVerify
(
path
string
)
error
{
path
,
err
:=
filepath
.
Abs
(
path
)
if
err
!=
nil
{
return
err
}
if
filepath
.
Base
(
path
)
!=
"irma_configuration"
{
return
errors
.
New
(
"Path is not irma_configuration"
)
}
conf
,
err
:=
irma
.
NewConfiguration
(
path
,
""
)
if
err
!=
nil
{
return
err
}
if
err
:=
conf
.
ParseFolder
();
err
!=
nil
{
return
err
}
for
_
,
manager
:=
range
conf
.
SchemeManagers
{
for
file
:=
range
manager
.
Index
{
// Don't care about the actual bytes
if
_
,
err
:=
conf
.
ReadAuthenticatedFile
(
manager
,
file
);
err
!=
nil
{
return
err
}
}
fmt
.
Println
()
fmt
.
Println
(
"irma_configuration parsed and authenticated successfully."
)
return
nil
},
}
return
nil
}
func
init
()
{
...
...
Write
Preview
Supports
Markdown
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