Skip to content
GitLab
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
1d9c696d
Commit
1d9c696d
authored
Jun 12, 2018
by
David Venhoek
Browse files
Changed capitalisation of ChangePin to be consistent.
parent
24f32567
Changes
4
Hide whitespace changes
Inline
Side-by-side
irmaclient/client.go
View file @
1d9c696d
...
...
@@ -80,17 +80,17 @@ type KeyshareHandler interface {
EnrollmentSuccess
(
manager
irma
.
SchemeManagerIdentifier
)
}
type
Change
p
inHandler
interface
{
Change
p
inFailure
(
manager
irma
.
SchemeManagerIdentifier
,
err
error
)
Change
p
inSuccess
(
manager
irma
.
SchemeManagerIdentifier
)
Change
p
inIncorrect
(
manager
irma
.
SchemeManagerIdentifier
)
type
Change
P
inHandler
interface
{
Change
P
inFailure
(
manager
irma
.
SchemeManagerIdentifier
,
err
error
)
Change
P
inSuccess
(
manager
irma
.
SchemeManagerIdentifier
)
Change
P
inIncorrect
(
manager
irma
.
SchemeManagerIdentifier
)
}
// ClientHandler informs the user that the configuration or the list of attributes
// that this client uses has been updated.
type
ClientHandler
interface
{
KeyshareHandler
Change
p
inHandler
Change
P
inHandler
UpdateConfiguration
(
new
*
irma
.
IrmaIdentifierSet
)
UpdateAttributes
()
...
...
@@ -755,16 +755,16 @@ func (client *Client) keyshareEnrollWorker(managerID irma.SchemeManagerIdentifie
return
nil
}
func
(
client
*
Client
)
KeyshareChange
p
in
(
manager
irma
.
SchemeManagerIdentifier
,
old
p
in
string
,
new
p
in
string
)
{
func
(
client
*
Client
)
KeyshareChange
P
in
(
manager
irma
.
SchemeManagerIdentifier
,
old
P
in
string
,
new
P
in
string
)
{
go
func
()
{
err
:=
client
.
keyshareChange
p
inWorker
(
manager
,
old
p
in
,
new
p
in
)
err
:=
client
.
keyshareChange
P
inWorker
(
manager
,
old
P
in
,
new
P
in
)
if
err
!=
nil
{
client
.
handler
.
Change
p
inFailure
(
manager
,
err
)
client
.
handler
.
Change
P
inFailure
(
manager
,
err
)
}
}()
}
func
(
client
*
Client
)
keyshareChange
p
inWorker
(
managerID
irma
.
SchemeManagerIdentifier
,
old
p
in
string
,
new
p
in
string
)
error
{
func
(
client
*
Client
)
keyshareChange
P
inWorker
(
managerID
irma
.
SchemeManagerIdentifier
,
old
P
in
string
,
new
P
in
string
)
error
{
kss
,
ok
:=
client
.
keyshareServers
[
managerID
]
if
!
ok
{
return
errors
.
New
(
"Unknown keyshare server"
)
...
...
@@ -773,8 +773,8 @@ func (client *Client) keyshareChangepinWorker(managerID irma.SchemeManagerIdenti
transport
:=
irma
.
NewHTTPTransport
(
kss
.
URL
)
message
:=
keyshareChangepin
{
Username
:
kss
.
Username
,
Old
p
in
:
kss
.
HashedPin
(
old
p
in
),
New
p
in
:
kss
.
HashedPin
(
new
p
in
),
Old
P
in
:
kss
.
HashedPin
(
old
P
in
),
New
P
in
:
kss
.
HashedPin
(
new
P
in
),
}
res
:=
&
keysharePinStatus
{}
...
...
@@ -784,9 +784,9 @@ func (client *Client) keyshareChangepinWorker(managerID irma.SchemeManagerIdenti
}
if
res
.
Status
!=
kssPinSuccess
{
client
.
handler
.
Change
p
inIncorrect
(
managerID
)
client
.
handler
.
Change
P
inIncorrect
(
managerID
)
}
else
{
client
.
handler
.
Change
p
inSuccess
(
managerID
)
client
.
handler
.
Change
P
inSuccess
(
managerID
)
}
return
nil
...
...
irmaclient/irmaclient_test.go
View file @
1d9c696d
...
...
@@ -42,20 +42,20 @@ func (i *TestClientHandler) EnrollmentFailure(manager irma.SchemeManagerIdentifi
i
.
t
.
Fatal
(
err
)
}
}
func
(
i
*
TestClientHandler
)
Change
p
inSuccess
(
manager
irma
.
SchemeManagerIdentifier
)
{
func
(
i
*
TestClientHandler
)
Change
P
inSuccess
(
manager
irma
.
SchemeManagerIdentifier
)
{
select
{
case
i
.
c
<-
nil
:
// nop
default
:
// nop
}
}
func
(
i
*
TestClientHandler
)
Change
p
inFailure
(
manager
irma
.
SchemeManagerIdentifier
,
err
error
)
{
func
(
i
*
TestClientHandler
)
Change
P
inFailure
(
manager
irma
.
SchemeManagerIdentifier
,
err
error
)
{
select
{
case
i
.
c
<-
err
:
//nop
default
:
i
.
t
.
Fatal
(
err
)
}
}
func
(
i
*
TestClientHandler
)
Change
p
inIncorrect
(
manager
irma
.
SchemeManagerIdentifier
)
{
func
(
i
*
TestClientHandler
)
Change
P
inIncorrect
(
manager
irma
.
SchemeManagerIdentifier
)
{
err
:=
errors
.
New
(
"incorrect pin"
)
select
{
case
i
.
c
<-
err
:
//nop
...
...
irmaclient/keyshare.go
View file @
1d9c696d
...
...
@@ -64,8 +64,8 @@ type keyshareEnrollment struct {
type
keyshareChangepin
struct
{
Username
string
`json:"id"`
Old
p
in
string
`json:"oldpin"`
New
p
in
string
`json:"newpin"`
Old
P
in
string
`json:"oldpin"`
New
P
in
string
`json:"newpin"`
}
type
keyshareAuthorization
struct
{
...
...
irmaclient/session_test.go
View file @
1d9c696d
...
...
@@ -367,11 +367,11 @@ func keyshareSessions(t *testing.T, client *Client) {
}
// Test pinchange interaction
func
TestKeyshareChange
p
in
(
t
*
testing
.
T
)
{
func
TestKeyshareChange
P
in
(
t
*
testing
.
T
)
{
client
:=
parseStorage
(
t
)
require
.
NoError
(
t
,
client
.
keyshareChange
p
inWorker
(
irma
.
NewSchemeManagerIdentifier
(
"test"
),
"12345"
,
"54321"
));
require
.
NoError
(
t
,
client
.
keyshareChange
p
inWorker
(
irma
.
NewSchemeManagerIdentifier
(
"test"
),
"54321"
,
"12345"
));
require
.
NoError
(
t
,
client
.
keyshareChange
P
inWorker
(
irma
.
NewSchemeManagerIdentifier
(
"test"
),
"12345"
,
"54321"
));
require
.
NoError
(
t
,
client
.
keyshareChange
P
inWorker
(
irma
.
NewSchemeManagerIdentifier
(
"test"
),
"54321"
,
"12345"
));
test
.
ClearTestStorage
(
t
)
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment