We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 077adfd commit f0ff7cdCopy full SHA for f0ff7cd
c-dependencies/js-compute-runtime/builtins/crypto-key.cpp
@@ -1,3 +1,4 @@
1
+#include <utility>
2
#include "crypto-key.h"
3
#include "crypto-algorithm.h"
4
#include "js-compute-builtins.h"
@@ -651,7 +652,9 @@ bool CryptoKey::canSign(JS::HandleObject self) {
651
652
653
bool CryptoKey::canVerify(JS::HandleObject self) {
654
MOZ_ASSERT(is_instance(self));
- auto usage = CryptoKeyUsages(JS::GetReservedSlot(self, Slots::Usages).toInt32());
655
+ auto usages = JS::GetReservedSlot(self, Slots::Usages).toInt32();
656
+ MOZ_ASSERT(std::in_range<std::uint8_t>(usages));
657
+ auto usage = CryptoKeyUsages(static_cast<uint8_t>(usages));
658
return usage.canVerify();
659
}
660
0 commit comments