-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support empty string in
Name.from_rfc4514_string()
(#10964)
Empty string is a valid result from RFC4514 serialization, and should parse successfully. According to https://datatracker.ietf.org/doc/html/rfc4514#section-2.1 > If the RDNSequence is an empty sequence, the result is the empty or zero-length string.
- Loading branch information
Showing
4 changed files
with
10 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5885,6 +5885,9 @@ def test_distinguished_name_custom_attrs(self): | |
{NameOID.COMMON_NAME: "CommonName", NameOID.EMAIL_ADDRESS: "E"} | ||
) == ("CommonName=Santa Claus,[email protected]") | ||
|
||
def test_empty_name(self): | ||
assert x509.Name([]).rfc4514_string() == "" | ||
|
||
def test_empty_value(self): | ||
na = x509.NameAttribute(NameOID.STATE_OR_PROVINCE_NAME, "") | ||
assert na.rfc4514_string() == r"ST=" | ||
|