Remove pki/tag.h
This is a very thin wrapper over CBS_ASN1_* constants, dating from when
the library wanted to avoid as strongly depending on BoringSSL. That's
long stopped being the case, so we may as well just use the underlying
constants. A tad less C++-y, but I don't think the wrapper is buying us
much.
Update-Note: pki/tag.h no longer exists. Use CBS_ASN1_TAG instead of
bssl::der::Tag and CBS_ASN1_* instead of bssl::der::k*.
Change-Id: I09f3f65b406d1a8fe60bfbe1a56d3e485ae84d97
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/66067
Commit-Queue: David Benjamin <davidben@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Bob Beck <bbe@google.com>
diff --git a/pki/signature_algorithm.cc b/pki/signature_algorithm.cc
index 8116862..73d8bc1 100644
--- a/pki/signature_algorithm.cc
+++ b/pki/signature_algorithm.cc
@@ -6,6 +6,7 @@
#include <openssl/bytestring.h>
#include <openssl/digest.h>
+
#include "input.h"
#include "parse_values.h"
#include "parser.h"
@@ -126,7 +127,7 @@
[[nodiscard]] bool IsNull(der::Input input) {
der::Parser parser(input);
der::Input null_value;
- if (!parser.ReadTag(der::kNull, &null_value)) {
+ if (!parser.ReadTag(CBS_ASN1_NULL, &null_value)) {
return false;
}
@@ -237,12 +238,15 @@
DigestAlgorithm hash, mgf1_hash;
der::Parser salt_length_parser;
uint64_t salt_length;
- if (!params_parser.ReadTag(der::ContextSpecificConstructed(0), &field) ||
+ if (!params_parser.ReadTag(
+ CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0, &field) ||
!ParseHashAlgorithm(field, &hash) ||
- !params_parser.ReadTag(der::ContextSpecificConstructed(1), &field) ||
+ !params_parser.ReadTag(
+ CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 1, &field) ||
!ParseMaskGenAlgorithm(field, &mgf1_hash) ||
- !params_parser.ReadConstructed(der::ContextSpecificConstructed(2),
- &salt_length_parser) ||
+ !params_parser.ReadConstructed(
+ CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 2,
+ &salt_length_parser) ||
!salt_length_parser.ReadUint64(&salt_length) ||
salt_length_parser.HasMore() || params_parser.HasMore()) {
return std::nullopt;
@@ -285,7 +289,7 @@
return false;
}
- if (!algorithm_identifier_parser.ReadTag(der::kOid, algorithm)) {
+ if (!algorithm_identifier_parser.ReadTag(CBS_ASN1_OBJECT, algorithm)) {
return false;
}