// Extract name & email from key userIds.
let i, match, myRegexp = XRegExp(/(.*) <(\S+@\S+)>$/g);
for (i in userIds) {
match = XRegExp.exec(userIds[i], myRegexp);
if(match === null) {
throw new Error('Error when parsing key user id');
}
userIdsSplited.push({
name: match[1],
email: match[2]
});
}
Apparently when "Comment" field is not blank, the userId is something like User Name <email@example.com> (comment here), which doesn't match the regex /(.*) <(\S+@\S+)>$/g, so the browser extension stops working. This means any action that requires reading the keys (password create, group member add, etc.) fails.
Passbolt breaks when setting up an account with the "Comment" field not blank
What you did
Filled in the "Comment" field on the Create a new key screen, when setting up an account.
What happened
On the last step, the extension throws this error: error importing the private key : Error when parsing key user id.
The json snippet is similar to this:
I think the problem is here: https://github.com/passbolt/passbolt_browser_extension/blob/aa8283378f6d8bcadfabc9ae96508f98c02232b9/src/all/background_page/model/keyring.js#L257
Apparently when "Comment" field is not blank, the
userId
is something likeUser Name <email@example.com> (comment here)
, which doesn't match the regex/(.*) <(\S+@\S+)>$/g
, so the browser extension stops working. This means any action that requires reading the keys (password create, group member add, etc.) fails.