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

Send language to keyshare server on registration

parent b911a847
......@@ -665,16 +665,16 @@ 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 *string, pin string) {
func (client *Client) KeyshareEnroll(manager irma.SchemeManagerIdentifier, email *string, pin string, lang string) {
go func() {
err := client.keyshareEnrollWorker(manager, email, pin)
err := client.keyshareEnrollWorker(manager, email, pin, lang)
if err != nil {
client.handler.EnrollmentFailure(manager, err)
}
}()
}
func (client *Client) keyshareEnrollWorker(managerID irma.SchemeManagerIdentifier, email *string, pin string) error {
func (client *Client) keyshareEnrollWorker(managerID irma.SchemeManagerIdentifier, email *string, pin string, lang string) error {
manager, ok := client.Configuration.SchemeManagers[managerID]
if !ok {
return errors.New("Unknown scheme manager")
......@@ -694,6 +694,7 @@ func (client *Client) keyshareEnrollWorker(managerID irma.SchemeManagerIdentifie
message := keyshareEnrollment{
Email: email,
Pin: kss.HashedPin(pin),
Language: lang,
PublicKey: (*paillierPublicKey)(&kss.PrivateKey.PublicKey),
}
......
......@@ -58,6 +58,7 @@ type keyshareEnrollment struct {
Pin string `json:"pin"`
PublicKey *paillierPublicKey `json:"publicKey"`
Email *string `json:"email"`
Language string `json:"language"`
}
type keyshareAuthorization struct {
......
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