Fix potential buffer overflow error CID: 40674
[platform/core/security/key-manager.git] / tests / test_common.h
1 #pragma once
2 #include <string>
3 #include <ckm/ckm-type.h>
4
5 // mirrors the API-defined value
6 #ifndef AES_GCM_TAG_SIZE
7 #define AES_GCM_TAG_SIZE 16
8 #endif
9
10 CKM::RawBuffer createDefaultPass();
11 CKM::RawBuffer createBigBlob(std::size_t size);
12
13 const CKM::RawBuffer defaultPass = createDefaultPass();
14 const std::string pattern =
15     "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f";
16
17 const std::size_t RAW_PASS_SIZE = 32;
18 const std::size_t HEX_PASS_SIZE = RAW_PASS_SIZE * 2;
19
20
21 std::string rawToHexString(const CKM::RawBuffer &raw);