65 lines
1.7 KiB
C
65 lines
1.7 KiB
C
/*
|
|
* 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 ODKITEE_SPECIAL_CASES_H_
|
|
#define ODKITEE_SPECIAL_CASES_H_
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#include "OEMCryptoCENC.h"
|
|
#include "message.h"
|
|
|
|
/* shared memory index used for destination buffers */
|
|
#define DEST_BUFFER_INDEX 3
|
|
|
|
/*
|
|
* Special cases due to union & shared memory
|
|
*/
|
|
void ODK_Pack_OEMCrypto_DestBufferDesc(Message* msg,
|
|
const OEMCrypto_DestBufferDesc* obj);
|
|
void ODK_Unpack_OEMCrypto_DestBufferDesc(Message* msg,
|
|
OEMCrypto_DestBufferDesc* obj);
|
|
|
|
/*
|
|
* Special cases due to parameters defined as having pointers into other parameters
|
|
*/
|
|
void ODK_Pack_RewrapDeviceRSAKey_Request(
|
|
Message* msg, OEMCrypto_SESSION session,
|
|
const uint8_t* message,
|
|
size_t message_length,
|
|
const uint8_t* signature,
|
|
size_t signature_length,
|
|
const uint32_t* unaligned_nonce,
|
|
const uint8_t* enc_rsa_key,
|
|
size_t enc_rsa_key_length,
|
|
const uint8_t* enc_rsa_key_iv,
|
|
const uint8_t* wrapped_rsa_key,
|
|
const size_t* wrapped_rsa_key_length);
|
|
|
|
void ODK_Unpack_RewrapDeviceRSAKey_Request(
|
|
Message* msg, OEMCrypto_SESSION* session,
|
|
SharedMemory** message,
|
|
size_t* message_length,
|
|
SharedMemory** signature,
|
|
size_t* signature_length,
|
|
uint32_t** unaligned_nonce,
|
|
uint8_t** enc_rsa_key,
|
|
size_t* enc_rsa_key_length,
|
|
uint8_t** enc_rsa_key_iv,
|
|
uint8_t** wrapped_rsa_key,
|
|
size_t** wrapped_rsa_key_length);
|
|
|
|
#ifdef __cplusplus
|
|
} // extern "C"
|
|
#endif
|
|
|
|
#endif // ODKITEE_SPECIAL_CASES_H_
|