Commit 622fbe05 authored by npzacs's avatar npzacs
Browse files

mmc_open(): removed deprecated parameters nonce and host_key_point

parent 2caf1f63
......@@ -182,15 +182,12 @@ static int _calc_vuk(AACS *aacs, const char *path)
cert_list *hccursor = aacs->cf->host_cert_list;
while (hccursor && hccursor->host_priv_key && hccursor->host_cert) {
uint8_t priv_key[20], cert[92], nonce[20], key_point[40];
uint8_t priv_key[20], cert[92];
hexstring_to_hex_array(priv_key, sizeof(priv_key),
hccursor->host_priv_key);
hexstring_to_hex_array(cert, sizeof(cert), hccursor->host_cert);
hexstring_to_hex_array(nonce, sizeof(nonce), hccursor->host_nonce);
hexstring_to_hex_array(key_point, sizeof(key_point),
hccursor->host_key_point);
if ((mmc = mmc_open(path, priv_key, cert, nonce, key_point))) {
if ((mmc = mmc_open(path, priv_key, cert))) {
if (mmc_read_vid(mmc, aacs->vid)) {
gcry_cipher_hd_t gcry_h;
gcry_cipher_open(&gcry_h, GCRY_CIPHER_AES,
......
......@@ -357,18 +357,14 @@ static int _mmc_read_vid(MMC *mmc, uint8_t agid, uint8_t *volume_id,
}
MMC *mmc_open(const char *path, const uint8_t *host_priv_key,
const uint8_t *host_cert, const uint8_t *host_nonce,
const uint8_t *host_key_point)
const uint8_t *host_cert)
{
MMC *mmc = calloc(1, sizeof(MMC));
if (host_priv_key) memcpy(mmc->host_priv_key, host_priv_key, 20);
if (host_cert) memcpy(mmc->host_cert, host_cert, 92);
if (host_nonce) {
memcpy(mmc->host_nonce, host_nonce, 20);
} else {
{
crypto_create_nonce(mmc->host_nonce, sizeof(mmc->host_nonce));
char str[sizeof(mmc->host_nonce)*2 + 1];
......@@ -376,10 +372,7 @@ MMC *mmc_open(const char *path, const uint8_t *host_priv_key,
print_hex(str, mmc->host_nonce, sizeof(mmc->host_nonce)));
}
if (host_key_point) {
memcpy(mmc->host_key_point, host_key_point, 40);
} else {
{
crypto_create_host_key_pair(mmc->host_key, mmc->host_key_point);
char str[sizeof(mmc->host_key_point)*2 + 1];
......
......@@ -27,9 +27,8 @@
typedef struct mmc MMC;
AACS_PRIVATE MMC *mmc_open(const char *path, const uint8_t *host_priv_key,
const uint8_t *host_cert, const uint8_t *host_nonce,
const uint8_t *host_key_point);
AACS_PRIVATE void mmc_close(MMC *drive);
const uint8_t *host_cert);
AACS_PRIVATE void mmc_close(MMC *mmc);
AACS_PRIVATE int mmc_read_vid(MMC *mmc, uint8_t *vid);
#endif /* MMC_H_ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment