Source release 19.5.0

This commit is contained in:
Cong Lin
2025-04-02 10:27:18 -07:00
parent 4407acee62
commit f7ec4fdeff
295 changed files with 32196 additions and 21748 deletions

View File

@@ -52,6 +52,7 @@ class CborValidator {
GetValidateMessages() const {
return validate_messages_;
}
std::string PrintValidateMessage() const;
// Prints |parse_result_| in readable format. Requires that Parse() is called
// first and |parse_result_| contains a valid CBOR message.
virtual std::string GetFormattedMessage() const;

View File

@@ -24,16 +24,20 @@ std::string StatusToString(FieldStatus status);
void ApplyStatus(CborMessageStatus& status, CborMessageStatus new_status);
// Validates that the given field name is present, and prints error messages
// if not.
// if not. It is acceptable that some field, although specified as required by
// DICE specification, is not present in practice. This function will return
// kCborValidateWarning instead of the default kCborValidateError in those
// cases.
template <typename T>
CborMessageStatus ValidateRequiredField(
const std::string& name, const std::string& component,
const std::pair<FieldStatus, T>& p,
std::vector<std::pair<CborMessageStatus, std::string>>& msgs) {
std::vector<std::pair<CborMessageStatus, std::string>>& msgs,
CborMessageStatus error = kCborValidateError) {
if (p.first != kPresent) {
msgs.push_back(std::make_pair(
kCborValidateError, component + ": missing required field " + name));
return kCborValidateError;
msgs.push_back(
std::make_pair(error, component + ": missing required field " + name));
return error;
}
return kCborValidateOk;
}