Commit e984652f authored by Sietse Ringers's avatar Sietse Ringers
Browse files

In enrolling, make email a pointer so it can be absent

parent 73d07457
......@@ -662,7 +662,7 @@ func (client *Client) unenrolledSchemeManagers() []irma.SchemeManagerIdentifier
}
// KeyshareEnroll attempts to enroll at the keyshare server of the specified scheme manager.
func (client *Client) KeyshareEnroll(manager irma.SchemeManagerIdentifier, email, pin string) {
func (client *Client) KeyshareEnroll(manager irma.SchemeManagerIdentifier, email *string, pin string) {
go func() {
defer func() {
if e := recover(); e != nil {
......@@ -679,7 +679,7 @@ func (client *Client) KeyshareEnroll(manager irma.SchemeManagerIdentifier, email
}()
}
func (client *Client) keyshareEnrollWorker(managerID irma.SchemeManagerIdentifier, email, pin string) error {
func (client *Client) keyshareEnrollWorker(managerID irma.SchemeManagerIdentifier, email *string, pin string) error {
manager, ok := client.Configuration.SchemeManagers[managerID]
if !ok {
return errors.New("Unknown scheme manager")
......@@ -692,7 +692,7 @@ func (client *Client) keyshareEnrollWorker(managerID irma.SchemeManagerIdentifie
}
transport := irma.NewHTTPTransport(manager.KeyshareServer)
kss, err := newKeyshareServer(managerID, client.paillierKey(true), manager.KeyshareServer, email)
kss, err := newKeyshareServer(managerID, client.paillierKey(true), manager.KeyshareServer)
if err != nil {
return err
}
......
......@@ -57,7 +57,7 @@ type keyshareEnrollment struct {
Username string `json:"username"`
Pin string `json:"pin"`
PublicKey *paillierPublicKey `json:"publicKey"`
Email string `json:"email"`
Email *string `json:"email"`
}
type keyshareAuthorization struct {
......@@ -116,12 +116,11 @@ const (
func newKeyshareServer(
schemeManagerIdentifier irma.SchemeManagerIdentifier,
privatekey *paillierPrivateKey,
url, email string,
url string,
) (ks *keyshareServer, err error) {
ks = &keyshareServer{
Nonce: make([]byte, 32),
URL: url,
Username: email,
PrivateKey: privatekey,
SchemeManagerIdentifier: schemeManagerIdentifier,
}
......
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