Commit 8efd429b authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Don't allow storing multiple instances of singleton credentials

parent c2034eeb
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment