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
8efd429b
Commit
8efd429b
authored
Oct 03, 2017
by
Sietse Ringers
Browse files
Don't allow storing multiple instances of singleton credentials
parent
c2034eeb
Changes
1
Hide whitespace changes
Inline
Side-by-side
manager.go
View file @
8efd429b
...
...
@@ -282,8 +282,12 @@ func (cm *CredentialManager) addCredential(cred *credential, storeAttributes boo
if
_
,
exists
:=
cm
.
credentials
[
id
];
!
exists
{
cm
.
credentials
[
id
]
=
make
(
map
[
int
]
*
credential
)
}
counter
:=
len
(
cm
.
attributes
[
id
])
-
1
cm
.
credentials
[
id
][
counter
]
=
cred
if
cred
.
CredentialType
()
.
IsSingleton
{
cm
.
credentials
[
id
][
0
]
=
cred
}
else
{
counter
:=
len
(
cm
.
attributes
[
id
])
-
1
cm
.
credentials
[
id
][
counter
]
=
cred
}
if
err
=
cm
.
storage
.
StoreSignature
(
cred
);
err
!=
nil
{
return
...
...
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