mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-08 13:50:20 +00:00
The null-key case pinned a NotImplemented throw, which the test conventions do not allow. The debt entry now links evp.h, where LibreSSL 2.5.4 defines the EVP_PKEY layout, instead of evp_local.h. Co-authored-by: MarcZX10 <[email protected]>
29 lines
780 B
C++
29 lines
780 B
C++
#include "prx/libSceLibreSsl/include/Api.hpp"
|
|
#include "prx/libc/include/general/VabiMacros.hpp"
|
|
#include <array>
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <cstdio>
|
|
#include <cstring>
|
|
#include <exception>
|
|
#include <limits>
|
|
|
|
|
|
namespace {
|
|
void Require(bool condition, const char* message) {
|
|
if (condition) return;
|
|
std::fprintf(stderr, "failed: %s\n", message);
|
|
std::terminate();
|
|
}
|
|
}
|
|
|
|
int main() {
|
|
alignas(8) std::array<std::byte, 64> pkey{};
|
|
constexpr int ids[] = {0, 1, 6, 408, 0x7fffffff, std::numeric_limits<int>::min()};
|
|
for (const int expected : ids) {
|
|
std::memcpy(pkey.data(), &expected, sizeof(expected));
|
|
Require(EVP_PKEY_id_nid_postfix(pkey.data()) == expected, "returns the key's stored type unchanged");
|
|
}
|
|
return 0;
|
|
}
|