diff options
author | Dave Airlie <airlied@redhat.com> | 2014-11-04 13:09:18 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2014-11-04 13:09:18 +1000 |
commit | 8cf7fe28f26d3508637fc7c9d0fdb9ae97683cc5 (patch) | |
tree | 12d975d6f3b2ec09ee4f81c6c0e49adda81b2ebd | |
parent | cc2d84ed16c42b8d833a3be22dc5f5057119c02e (diff) |
fix some warnings
-rw-r--r-- | dl3.c | 23 |
1 files changed, 7 insertions, 16 deletions
@@ -34,9 +34,9 @@ struct hdcp_session_info { EVP_CIPHER_CTX aes_ctx; /* ctx for cipher */ uint8_t kd[KD_SIZE]; uint8_t edkey_ks[16]; - uint8_t *rtx; - uint8_t *km; - uint8_t *ks; + const uint8_t *rtx; + const uint8_t *km; + const uint8_t *ks; }; static int VID = 0x17e9; static int PID = 0x4301; @@ -163,12 +163,7 @@ static void calculate_kd(struct hdcp_session_info *info) static void calculate_edkey_ks(struct hdcp_session_info *info) { - unsigned char input[] = {NULL_BYTES, NULL_BYTES}; - uint8_t iv[16]; uint8_t *buf = info->edkey_ks; - int ret; - int outl; - uint8_t tmp[100]; int i; calc_kd_ctr(info, 2, buf); @@ -194,7 +189,6 @@ static int calculate_h(struct hdcp_session_info *info) HMAC_CTX ctx; unsigned char res[200]; unsigned int resLen; - int i; uint8_t input[8]; memcpy(input, info->rtx, 8); @@ -266,7 +260,7 @@ static int verify_cert(const uint8_t *start) ctx = EVP_PKEY_CTX_new(pRsaKey, NULL); if (EVP_PKEY_verify_init(ctx) <= 0) { printf("fail 1\n"); - return; + return -1; } #if 1 mdctx = EVP_MD_CTX_create(); @@ -397,10 +391,6 @@ static void decode_l_prime(struct hdcp_session_info *info, static void decode_rx(struct hdcp_session_info *info, const uint8_t *buf, int len) { - /**/ - int msglen = buf[2] | (buf[3] << 8); - int midlen; - if (buf[0] != 0 || buf[1] != 0) return; @@ -473,10 +463,10 @@ static int block_read_usb(libusb_device_handle *handle, int endpoint_in, static int send_buffer(libusb_device_handle *handle, int endpoint_out, int endpoint_in) { unsigned char buf[1024]; - int r, i = 0; + int r; int size; int len2, len; - gcry_sexp_t pub_key, km, result; + gcry_sexp_t km, result; struct hdcp_session_info info; memset(&info, 0, sizeof(info)); @@ -662,4 +652,5 @@ int main(int argc, char** argv) libusb_exit(NULL); #endif + return 0; } |