Update some comments in bn_test.c in light of acb24518.

Change acb24518 renamed some functions, but there were some dangling
references in bn_test.c. Thanks to Brian Smith for noticing.

This change has no semantic effect.

Change-Id: Id149505090566583834be3abce2cee28b8c248e2
Reviewed-on: https://boringssl-review.googlesource.com/7040
Reviewed-by: David Benjamin <davidben@google.com>
This commit is contained in:
Adam Langley 2016-02-02 08:49:30 -08:00 committed by David Benjamin
parent 47ebec1210
commit dd31c4eba2

View File

@ -1799,8 +1799,8 @@ static const ASN1InvalidTest kASN1InvalidTests[] = {
{"\x02\x00", 2}, {"\x02\x00", 2},
}; };
// kASN1BuggyTests are incorrect encodings and how |BN_cbs2unsigned_buggy| // kASN1BuggyTests contains incorrect encodings and the corresponding, expected
// should interpret them. // results of |BN_parse_asn1_unsigned_buggy| given that input.
static const ASN1Test kASN1BuggyTests[] = { static const ASN1Test kASN1BuggyTests[] = {
// Negative numbers. // Negative numbers.
{"128", "\x02\x01\x80", 3}, {"128", "\x02\x01\x80", 3},
@ -1850,7 +1850,7 @@ static bool test_asn1() {
return false; return false;
} }
// |BN_cbs2unsigned_buggy| parses all valid input. // |BN_parse_asn1_unsigned_buggy| parses all valid input.
CBS_init(&cbs, reinterpret_cast<const uint8_t*>(test.der), test.der_len); CBS_init(&cbs, reinterpret_cast<const uint8_t*>(test.der), test.der_len);
if (!BN_parse_asn1_unsigned_buggy(&cbs, bn2.get()) || CBS_len(&cbs) != 0) { if (!BN_parse_asn1_unsigned_buggy(&cbs, bn2.get()) || CBS_len(&cbs) != 0) {
fprintf(stderr, "Parsing ASN.1 INTEGER failed.\n"); fprintf(stderr, "Parsing ASN.1 INTEGER failed.\n");
@ -1876,7 +1876,7 @@ static bool test_asn1() {
ERR_clear_error(); ERR_clear_error();
// All tests in kASN1InvalidTests are also rejected by // All tests in kASN1InvalidTests are also rejected by
// |BN_cbs2unsigned_buggy|. // |BN_parse_asn1_unsigned_buggy|.
CBS_init(&cbs, reinterpret_cast<const uint8_t*>(test.der), test.der_len); CBS_init(&cbs, reinterpret_cast<const uint8_t*>(test.der), test.der_len);
if (BN_parse_asn1_unsigned_buggy(&cbs, bn.get())) { if (BN_parse_asn1_unsigned_buggy(&cbs, bn.get())) {
fprintf(stderr, "Parsed invalid input.\n"); fprintf(stderr, "Parsed invalid input.\n");
@ -1886,7 +1886,7 @@ static bool test_asn1() {
} }
for (const ASN1Test &test : kASN1BuggyTests) { for (const ASN1Test &test : kASN1BuggyTests) {
// These broken encodings are rejected by |BN_cbs2unsigned|. // These broken encodings are rejected by |BN_parse_asn1_unsigned|.
ScopedBIGNUM bn(BN_new()); ScopedBIGNUM bn(BN_new());
if (!bn) { if (!bn) {
return false; return false;
@ -1900,7 +1900,7 @@ static bool test_asn1() {
} }
ERR_clear_error(); ERR_clear_error();
// However |BN_cbs2unsigned_buggy| accepts them. // However |BN_parse_asn1_unsigned_buggy| accepts them.
ScopedBIGNUM bn2 = ASCIIToBIGNUM(test.value_ascii); ScopedBIGNUM bn2 = ASCIIToBIGNUM(test.value_ascii);
if (!bn2) { if (!bn2) {
return false; return false;