diff --git a/lib/src/legacy/legacy_h26x_auth.c b/lib/src/legacy/legacy_h26x_auth.c index 112adff..c494618 100644 --- a/lib/src/legacy/legacy_h26x_auth.c +++ b/lib/src/legacy/legacy_h26x_auth.c @@ -117,7 +117,7 @@ legacy_verify_hashes_with_hash_list(legacy_sv_t *self, assert(hash_size > 0); // Expected hashes. uint8_t *expected_hashes = self->gop_info->hash_list; - const int num_expected_hashes = self->gop_info->list_idx / hash_size; + const int num_expected_hashes = (const int)(self->gop_info->list_idx / hash_size); legacy_h26x_nalu_list_t *nalu_list = self->nalu_list; legacy_h26x_nalu_list_item_t *last_used_item = NULL; diff --git a/lib/src/signed_video_h26x_auth.c b/lib/src/signed_video_h26x_auth.c index f4e3380..7132033 100644 --- a/lib/src/signed_video_h26x_auth.c +++ b/lib/src/signed_video_h26x_auth.c @@ -293,7 +293,7 @@ verify_hashes_with_hash_list(signed_video_t *self, assert(hash_size > 0); // Expected hashes. uint8_t *expected_hashes = self->gop_info->hash_list; - const int num_expected_hashes = self->gop_info->list_idx / hash_size; + const int num_expected_hashes = (const int)(self->gop_info->list_idx / hash_size); h26x_nalu_list_t *nalu_list = self->nalu_list; h26x_nalu_list_item_t *last_used_item = NULL; diff --git a/lib/src/signed_video_h26x_common.c b/lib/src/signed_video_h26x_common.c index b04ba6d..db2a650 100644 --- a/lib/src/signed_video_h26x_common.c +++ b/lib/src/signed_video_h26x_common.c @@ -967,7 +967,7 @@ check_and_copy_hash_to_hash_list(signed_video_t *self, const uint8_t *hash, size // a valid |hash_list| exists, and the |hash| can be copied to it. if (*list_idx >= 0) { memcpy(&hash_list[*list_idx], hash, hash_size); - *list_idx += hash_size; + *list_idx += (int)hash_size; } openssl_update_hash(self->crypto_handle, hash, hash_size, true); } diff --git a/lib/src/signed_video_h26x_nalu_list.c b/lib/src/signed_video_h26x_nalu_list.c index 0f76a94..a44938e 100644 --- a/lib/src/signed_video_h26x_nalu_list.c +++ b/lib/src/signed_video_h26x_nalu_list.c @@ -324,7 +324,7 @@ h26x_nalu_list_copy_last_item(h26x_nalu_list_t *list, bool hash_algo_known) while (!(item->nalu)) { item = item->prev; } - int hashable_data_offset = item->nalu->hashable_data - item->nalu->nalu_data; + int hashable_data_offset = (int)(item->nalu->hashable_data - item->nalu->nalu_data); svrc_t status = SV_UNKNOWN_FAILURE; SV_TRY() diff --git a/lib/src/signed_video_openssl.c b/lib/src/signed_video_openssl.c index 4c66d95..c6784db 100644 --- a/lib/src/signed_video_openssl.c +++ b/lib/src/signed_video_openssl.c @@ -108,7 +108,7 @@ openssl_private_key_malloc(sign_or_verify_data_t *sign_data, svrc_t status = SV_UNKNOWN_FAILURE; SV_TRY() // Read private key - BIO *bp = BIO_new_mem_buf(private_key, private_key_size); + BIO *bp = BIO_new_mem_buf(private_key, (int)private_key_size); signing_key = PEM_read_bio_PrivateKey(bp, NULL, NULL, NULL); BIO_free(bp); SV_THROW_IF(!signing_key, SV_EXTERNAL_ERROR); @@ -406,7 +406,7 @@ oid_to_type(message_digest_t *self) // Point to the first byte of the OID. The |oid_ptr| will increment while decoding. encoded_oid_ptr = self->encoded_oid; SV_THROW_IF( - !d2i_ASN1_OBJECT(&obj, &encoded_oid_ptr, self->encoded_oid_size), SV_EXTERNAL_ERROR); + !d2i_ASN1_OBJECT(&obj, &encoded_oid_ptr, (long)self->encoded_oid_size), SV_EXTERNAL_ERROR); self->type = EVP_get_digestbyobj(obj); self->size = EVP_MD_size(self->type); SV_CATCH() @@ -531,7 +531,7 @@ openssl_encoded_oid_to_str(const unsigned char *encoded_oid, size_t encoded_oid_ } // Point to the first byte of the OID. The |oid_ptr| will increment while decoding. - if (!d2i_ASN1_OBJECT(&obj, &encoded_oid, encoded_oid_size)) { + if (!d2i_ASN1_OBJECT(&obj, &encoded_oid, (long)encoded_oid_size)) { goto done; } OBJ_obj2txt(algo_name, 50, obj, 1);