This patch adds a suite of tests for OEMCrypto that verifying buffer overflow and off-by-one errors. The reference code has also been updated to pass these tests. The ODK library and the OEMCrypto API have not changed since the release of version 16.4.
21 lines
467 B
C++
21 lines
467 B
C++
// Copyright 2019 Google LLC. All Rights Reserved. This file and proprietary
|
|
// source code may only be used and distributed under the Widevine License
|
|
// Agreement.
|
|
|
|
#ifndef WVCDM_UTIL_ARRAYSIZE_H_
|
|
#define WVCDM_UTIL_ARRAYSIZE_H_
|
|
|
|
#include <stdint.h>
|
|
|
|
namespace wvcdm {
|
|
|
|
// Returns the size of a fixed-length array.
|
|
template <typename T, size_t N>
|
|
constexpr size_t ArraySize(const T (&)[N]) {
|
|
return N;
|
|
}
|
|
|
|
} // namespace wvcdm
|
|
|
|
#endif // WVCDM_UTIL_ARRAYSIZE_H_
|