Skip to content

Email extraction edge case fixed

Wim Van de Meerssche requested to merge wvdemeer/emulab-devel:patch-1 into master

2 edge cases combined resulted in the wrong email being extracted:

  • Email address with + in the name part it. (typical case: name.lastname+prefix@gmail.com)
  • Certificates with a DN that has fields positioned after the emailAddress (GN and SN in our case)

So this at the end of the DN failed: emailAdress=firstname.lastname+prefix@gmail.com/GN=firstname/SN=lastname It resulted in this extracted email address: firstname.lastname+prefix@gmail.com/GN=firstname/SN=lastname

This fixes both issues.

Note that it adds one assumption: there can never be any comma, slash or space in an email address.

Merge request reports