summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-11-04 18:49:08 +1000
committerDave Airlie <airlied@redhat.com>2014-11-04 18:49:08 +1000
commitac2c399d69a4255366235ce5ecf79337b9addb2a (patch)
tree7ca18efcd34036a91200ba1e615d92216f057f3a
parentfba2c4827864b074c82f275ad39d437217af4c41 (diff)
set msgs 2 hdrs different
-rw-r--r--dl3.c16
-rw-r--r--dl3_hdcp.c21
-rw-r--r--dl_pkts.h4
3 files changed, 21 insertions, 20 deletions
diff --git a/dl3.c b/dl3.c
index 18b6326..0ba12bb 100644
--- a/dl3.c
+++ b/dl3.c
@@ -483,13 +483,13 @@ static int send_buffer(libusb_device_handle *handle, int endpoint_out, int endpo
if (r != 0)
goto out;
- dl3_msg2_hdr25(buf, &len);
+ dl3_msg2_hdr(buf, &len, 0x25, 0x05, 0x08);
r = write_to_usb(handle, endpoint_out, buf, len, &size);
if (r != 0)
goto out;
memset(buf, 0, 1024);
- dl3_msg2_hdr04(buf, &len);
+ dl3_msg2_hdr(buf, &len, 0x04, 0x04, 0x00);
len2 = len;
dl3_packet_hdcp_ake_init(&buf[len], &len, info.rtx);
len2 += len;
@@ -586,6 +586,18 @@ static int send_buffer(libusb_device_handle *handle, int endpoint_out, int endpo
decode_rx(&info, buf, size);
/* find L' */
} while (1);
+
+ dl3_msg2_hdr(buf, &len, 0x45, 0x05, 0x0e);
+ r = write_to_usb(handle, endpoint_out, buf, len, &size);
+ if (r != 0)
+ goto out;
+
+ dl3_msg2_hdr(buf, &len, 0x06, 0x04, 0x06);
+ r = write_to_usb(handle, endpoint_out, buf, len, &size);
+ if (r != 0)
+ goto out;
+
+
r = 0;
out:
EVP_CIPHER_CTX_cleanup(&info.aes_ctx);
diff --git a/dl3_hdcp.c b/dl3_hdcp.c
index d2aeea5..799432d 100644
--- a/dl3_hdcp.c
+++ b/dl3_hdcp.c
@@ -69,27 +69,16 @@ void dl3_empty_packet(uint8_t *buf, int *len)
*len = 16;
}
-void dl3_msg2_hdr25(uint8_t *buf, int *len_p)
+void dl3_msg2_hdr(uint8_t *buf, int *len_p, int hdr_num,
+ uint16_t val1, uint16_t val2)
{
int len = 0x1c;
memset(buf, 0, len + 4);
fill_hdcp_header1(buf, len, MSG_TYPE_2);
- fill_hdcp_header2(buf, MSG2_25);
+ fill_hdcp_header2(buf, hdr_num);
- buf[16] = 0x5;
- buf[18] = 0x8;
-
- *len_p = len + 4;
-}
-
-void dl3_msg2_hdr04(uint8_t *buf, int *len_p)
-{
- int len = 0x1c;
- memset(buf, 0, len+4);
- fill_hdcp_header1(buf, len, MSG_TYPE_2);
- fill_hdcp_header2(buf, MSG2_04);
-
- buf[16] = 0x4;
+ buf[16] = val1 & 0xff;
+ buf[18] = val2 & 0xff;
*len_p = len + 4;
}
diff --git a/dl_pkts.h b/dl_pkts.h
index f78d2d6..8623689 100644
--- a/dl_pkts.h
+++ b/dl_pkts.h
@@ -3,8 +3,8 @@
#include <stdint.h>
void dl3_empty_packet(uint8_t *buf, int *len);
-void dl3_msg2_hdr25(uint8_t *buf, int *len_p);
-void dl3_msg2_hdr04(uint8_t *buf, int *len_p);
+void dl3_msg2_hdr(uint8_t *buf, int *len_p, int hdr_num,
+ uint16_t val1, uint16_t val2);
void dl3_packet_hdcp_ake_init(uint8_t *buf, int *len_p, const uint8_t *Rtx);
void dl3_packet_hdcp_ake_no_stored_km(uint8_t *buf, int *len_p, const uint8_t *ekpubkm);
void dl3_packet_hdcp_lc_init(uint8_t *buf, int *len_p, const uint8_t *Rn);