mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge "Fix a couple of regular expressions." am: 9d99ac49a1 am: e2c5959728 am: 63c4e00963
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2296477 Change-Id: Ibea59a7e9a9bc44003b57601a46571f4e1ce14a5 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1919,30 +1919,32 @@ void check_cose_key(const vector<uint8_t>& data, bool testMode) {
|
||||
|
||||
// The following check assumes that canonical CBOR encoding is used for the COSE_Key.
|
||||
if (testMode) {
|
||||
EXPECT_THAT(cppbor::prettyPrint(parsedPayload.get()),
|
||||
MatchesRegex("{\n"
|
||||
" 1 : 2,\n" // kty: EC2
|
||||
" 3 : -7,\n" // alg: ES256
|
||||
" -1 : 1,\n" // EC id: P256
|
||||
// The regex {(0x[0-9a-f]{2}, ){31}0x[0-9a-f]{2}} matches a
|
||||
// sequence of 32 hexadecimal bytes, enclosed in braces and
|
||||
// separated by commas. In this case, some Ed25519 public key.
|
||||
" -2 : {(0x[0-9a-f]{2}, ){31}0x[0-9a-f]{2}},\n" // pub_x: data
|
||||
" -3 : {(0x[0-9a-f]{2}, ){31}0x[0-9a-f]{2}},\n" // pub_y: data
|
||||
" -70000 : null,\n" // test marker
|
||||
"}"));
|
||||
EXPECT_THAT(
|
||||
cppbor::prettyPrint(parsedPayload.get()),
|
||||
MatchesRegex("\\{\n"
|
||||
" 1 : 2,\n" // kty: EC2
|
||||
" 3 : -7,\n" // alg: ES256
|
||||
" -1 : 1,\n" // EC id: P256
|
||||
// The regex {(0x[0-9a-f]{2}, ){31}0x[0-9a-f]{2}} matches a
|
||||
// sequence of 32 hexadecimal bytes, enclosed in braces and
|
||||
// separated by commas. In this case, some Ed25519 public key.
|
||||
" -2 : \\{(0x[0-9a-f]{2}, ){31}0x[0-9a-f]{2}\\},\n" // pub_x: data
|
||||
" -3 : \\{(0x[0-9a-f]{2}, ){31}0x[0-9a-f]{2}\\},\n" // pub_y: data
|
||||
" -70000 : null,\n" // test marker
|
||||
"\\}"));
|
||||
} else {
|
||||
EXPECT_THAT(cppbor::prettyPrint(parsedPayload.get()),
|
||||
MatchesRegex("{\n"
|
||||
" 1 : 2,\n" // kty: EC2
|
||||
" 3 : -7,\n" // alg: ES256
|
||||
" -1 : 1,\n" // EC id: P256
|
||||
// The regex {(0x[0-9a-f]{2}, ){31}0x[0-9a-f]{2}} matches a
|
||||
// sequence of 32 hexadecimal bytes, enclosed in braces and
|
||||
// separated by commas. In this case, some Ed25519 public key.
|
||||
" -2 : {(0x[0-9a-f]{2}, ){31}0x[0-9a-f]{2}},\n" // pub_x: data
|
||||
" -3 : {(0x[0-9a-f]{2}, ){31}0x[0-9a-f]{2}},\n" // pub_y: data
|
||||
"}"));
|
||||
EXPECT_THAT(
|
||||
cppbor::prettyPrint(parsedPayload.get()),
|
||||
MatchesRegex("\\{\n"
|
||||
" 1 : 2,\n" // kty: EC2
|
||||
" 3 : -7,\n" // alg: ES256
|
||||
" -1 : 1,\n" // EC id: P256
|
||||
// The regex {(0x[0-9a-f]{2}, ){31}0x[0-9a-f]{2}} matches a
|
||||
// sequence of 32 hexadecimal bytes, enclosed in braces and
|
||||
// separated by commas. In this case, some Ed25519 public key.
|
||||
" -2 : \\{(0x[0-9a-f]{2}, ){31}0x[0-9a-f]{2}\\},\n" // pub_x: data
|
||||
" -3 : \\{(0x[0-9a-f]{2}, ){31}0x[0-9a-f]{2}\\},\n" // pub_y: data
|
||||
"\\}"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user