Project

General

Profile

Actions

Bug #5351

closed

Email Probe doesn't cover some valid emails

Added by Adam Thieme 20 days ago. Updated 18 days ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Slashes and '=' are allowed in the local/first part of an email address, according to RFC 3696
https://www.rfc-editor.org/rfc/rfc3696#section-3

   Without quotes, local-parts may consist of any combination of
   alphabetic characters, digits, or any of the special characters

      ! # $ % & ' * + - / = ?  ^ _ ` . { | } ~

Requesting an email with a slash results in INVALID_PARAMETER error from CA:

Step 2: Please provide information for name assignment
Please input: email
first/last@sub.domain.tld
Got it. This is what you've provided:
email : first/last@sub.domain.tld
The probed CA response cannot be used because: Error info replied from the CA with Error code: INVALID_PARAMETER and Error Info: Cannot generate available names from parameters provided.

This example email from the RFC also fails in the same way:

customer/department=shipping@example.com

The ndn::name::Component object can take such an email as input and can then be added to an ndn::Name, which works outside ndncert.

When using it in an assignName() function (see https://gerrit.named-data.net/c/ndncert/+/7662),

std::vector <ndn::PartialName>
AssignmentEmailv2::assignName(const std::multimap<std::string, std::string>& params)
{
  std::vector<ndn::PartialName> returnList;
  const std::string& email = params.begin()->second;
  const Name result((ndn::name::Component(email)));
  returnList.push_back(std::move(result));
  return returnList;
}

the CA crashes with this error in ndn-cxx if there is a '/' or '=' in the email:

1741858410.297562 TRACE: [ndncert.ca] Received PROBE request
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<ndn::tlv::Error> >'
  what():  Expecting Name element, but TLV has type 8
Aborted (core dumped)

traced back to here https://github.com/named-data/ndn-cxx/blob/0ba3d3a9d9701be4baa3969fe50e97e89d11249b/ndn-cxx/encoding/tlv.cpp#L29

Actions

Also available in: Atom PDF