-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add generating CWT for tests #4820
Conversation
enum Parameter : int { | ||
// COSE Key Common parameters. | ||
// <https://datatracker.ietf.org/doc/html/rfc8152#section-7.1> | ||
enum CoseKeyCommonParameter : int { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
partially pre-existing, but I think that in general using enum class
is preferred. See https://abseil.io/tips/86
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to refactor this library as part of #4818
And will implement enum classes
auto serialized_cwt_string = std::string(serialized_cwt->begin(), serialized_cwt->end()); | ||
|
||
auto deserialized_cwt = Cwt::Deserialize(serialized_cwt_string); | ||
EXPECT_TRUE(deserialized_cwt.ok()) << deserialized_cwt.status(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EXPECT_OK(serialized_cwt)
EXPECT_OK(deserialized_cwt)
I think this will print the status on failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like EXPECT_OK
is not available externally:
cc/utils/cose/cwt_test.cc:72:3: error: 'EXPECT_OK' was not declared in this scope; did you mean 'EXPECT_EQ'?
72 | EXPECT_OK(serialized_cwt) << serialized_cwt.status();
| ^~~~~~~~~
| EXPECT_EQ
This PR adds functions to generate COSE_Sign1, COSE_Key and CWT certificates for testing purposes.
These functions are currently not fully implemented and only provide serializing an HPKE public key.
Ref #3641
Ref #4074
Ref #4627