diff options
author | Ryan Prichard <rprichard@google.com> | 2024-02-13 17:33:57 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-02-13 17:33:57 +0000 |
commit | 06c5483c920ff9f2f80ca92c17d0d30018cd99df (patch) | |
tree | 4ab5abbe93f4b53111e71bc5f234ff40c015cc0e | |
parent | efa69932ed3a2131ec91bdb095f45be5edbb3753 (diff) | |
parent | 4f45c51217398fe6c788a51754d348d19b714ca5 (diff) | |
download | keymaster-06c5483c920ff9f2f80ca92c17d0d30018cd99df.tar.gz |
Merge "Replace basic_string_view<uint8_t> with std::span" into main
-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()); } }; |