Skip to content

Commit

Permalink
more testing
Browse files Browse the repository at this point in the history
  • Loading branch information
lrstewart committed Nov 21, 2024
1 parent a315e22 commit fa69ad5
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/unit/s2n_certificate_parsing_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,23 @@ int main(int argc, char **argv)
"--" BEGIN_CERT "--" CERTIFICATE_2 "--" END_CERT
"--" BEGIN_CERT "--" CERTIFICATE_3 "--" END_CERT "--" ,
},
{
.name = "non-certificate data",
.input =
"this is not a certificate\n"
BEGIN_CERT_LINE "\n"
CERTIFICATE_1 "\n"
END_CERT_LINE "\n"
"\n"
"this is not a certificate either\n"
"\n"
BEGIN_CERT_LINE "\n"
CERTIFICATE_2 "\n"
END_CERT_LINE "not a certificate\n"
"not a certificate" BEGIN_CERT_LINE "\n"
CERTIFICATE_3 "\n"
END_CERT_LINE "\n",
},
{
.name = "comments",
.input =
Expand Down Expand Up @@ -333,6 +350,21 @@ int main(int argc, char **argv)
"\n"
"\n",
},
{
.name = "trailing non-certificate data",
.input =
BEGIN_CERT_LINE "\n"
CERTIFICATE_1 "\n"
END_CERT_LINE "\n"
BEGIN_CERT_LINE "\n"
CERTIFICATE_2 "\n"
END_CERT_LINE "\n"
BEGIN_CERT_LINE "\n"
CERTIFICATE_3 "\n"
END_CERT_LINE "\n"
"this is not a certificate\n"
"neither is this",
},
};
/* clang-format on */

Expand Down

0 comments on commit fa69ad5

Please sign in to comment.