diff options
author | Ryan Prichard <rprichard@google.com> | 2024-02-13 18:10:42 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2024-02-13 18:10:42 +0000 |
commit | 1de0f0905e93f9f470708288ef65c77fc84c1f36 (patch) | |
tree | 4ab5abbe93f4b53111e71bc5f234ff40c015cc0e | |
parent | fe1f69ca49ec349ff78d5e14c4e480e4f85e50b4 (diff) | |
parent | 06c5483c920ff9f2f80ca92c17d0d30018cd99df (diff) | |
download | keymaster-1de0f0905e93f9f470708288ef65c77fc84c1f36.tar.gz |
Merge "Replace basic_string_view<uint8_t> with std::span" into main am: 06c5483c92
Original change: https://android-review.googlesource.com/c/platform/system/keymaster/+/2959242
Change-Id: Iabe6cfc538b9219807d0ea9000ecdc558881296f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | android_keymaster/remote_provisioning_utils.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/android_keymaster/remote_provisioning_utils.cpp b/android_keymaster/remote_provisioning_utils.cpp index 7d9b7ec..fb06850 100644 --- a/android_keymaster/remote_provisioning_utils.cpp +++ b/android_keymaster/remote_provisioning_utils.cpp @@ -14,10 +14,13 @@ * limitations under the License. */ -#include "keymaster/cppcose/cppcose.h" -#include <keymaster/logger.h> #include <keymaster/remote_provisioning_utils.h> -#include <string_view> + +#include <algorithm> +#include <span> + +#include <keymaster/cppcose/cppcose.h> +#include <keymaster/logger.h> namespace keymaster { @@ -40,7 +43,7 @@ using cppcose::OCTET_KEY_PAIR; using cppcose::P256; using cppcose::verifyAndParseCoseSign1; -using byte_view = std::basic_string_view<uint8_t>; +using byte_view = std::span<const uint8_t>; struct KeyInfo { CoseKeyCurve curve; @@ -49,7 +52,8 @@ struct KeyInfo { // that all root keys are EDDSA. bool operator==(const KeyInfo& other) const { - return curve == other.curve && pubkey == other.pubkey; + return curve == other.curve && + std::equal(pubkey.begin(), pubkey.end(), other.pubkey.begin(), other.pubkey.end()); } }; |