odk: core serialization structs & functions
odk directory copied from wvgerrit. branch oemcrypto-v16 commit 0c9a7dc Bug: 140758896 Test: odk_test Change-Id: I0c631f771b794468a63e4395f6b9c3b60a1dfd4f
This commit is contained in:
64
libwvdrmengine/oemcrypto/odk/test/odk_test.h
Normal file
64
libwvdrmengine/oemcrypto/odk/test/odk_test.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright 2019 Google LLC. All Rights Reserved. This file and proprietary
|
||||
* source code may only be used and distributed under the Widevine Master
|
||||
* License Agreement.
|
||||
*/
|
||||
|
||||
#ifndef ODK_TEST_H_
|
||||
#define ODK_TEST_H_
|
||||
|
||||
#include "OEMCryptoCENCCommon.h"
|
||||
|
||||
typedef enum {
|
||||
ODK_License_Request_Type = 1,
|
||||
ODK_License_Response_Type = 2,
|
||||
ODK_Renewal_Request_Type = 3,
|
||||
ODK_Renewal_Response_Type = 4,
|
||||
ODK_Provisioning_Request_Type = 5,
|
||||
ODK_Provisioning_Response_Type = 6,
|
||||
} ODK_MessageType;
|
||||
|
||||
typedef enum {
|
||||
ODK_UINT32,
|
||||
ODK_UINT64,
|
||||
ODK_SUBSTRING,
|
||||
ODK_DEVICEID,
|
||||
ODK_HASH,
|
||||
ODK_NUMTYPES,
|
||||
} ODK_FieldType;
|
||||
|
||||
typedef enum {
|
||||
ODK_READ,
|
||||
ODK_WRITE,
|
||||
} ODK_FieldMode;
|
||||
|
||||
typedef struct {
|
||||
ODK_FieldType type;
|
||||
void* value;
|
||||
} ODK_Field;
|
||||
|
||||
#define DEVICE_ID_MAX (64)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
size_t ODK_FieldLength(ODK_FieldType type);
|
||||
OEMCryptoResult ODK_WriteSingleField(uint8_t* const buf,
|
||||
const ODK_Field* const field);
|
||||
OEMCryptoResult ODK_ReadSingleField(const uint8_t* const buf,
|
||||
const ODK_Field* const field);
|
||||
|
||||
OEMCryptoResult ODK_ReadFields(const uint8_t* const buf, const size_t size_in,
|
||||
size_t* size_out, const size_t n,
|
||||
const ODK_Field* const fields);
|
||||
|
||||
OEMCryptoResult ODK_WriteFields(uint8_t* const buf, const size_t size_in,
|
||||
size_t* size_out, const size_t n,
|
||||
const ODK_Field* const fields);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // ODK_TEST_H_
|
||||
Reference in New Issue
Block a user