Skip to content

Replace deprecated CC_MD5 with CC_SHA256 for cache key generation - #658

Open
PullaguraSatish wants to merge 1 commit into
pinterest:masterfrom
PullaguraSatish:feature/replace-md5-with-sha256
Open

Replace deprecated CC_MD5 with CC_SHA256 for cache key generation#658
PullaguraSatish wants to merge 1 commit into
pinterest:masterfrom
PullaguraSatish:feature/replace-md5-with-sha256

Conversation

@PullaguraSatish

Copy link
Copy Markdown

Summary

This PR replaces the deprecated CC_MD5 APIs with CC_SHA256 in PINRemoteImageManager when generating hashed cache keys.

Motivation

Apple has deprecated the CC_MD5 APIs, and many security scanning tools (such as NowSecure) flag MD5 usage even when it is used for non-cryptographic purposes. Replacing it with SHA-256 removes the dependency on the deprecated hashing algorithm while continuing to generate deterministic cache keys.

Changes

  • Replaced CC_MD5_CTX with CC_SHA256_CTX
  • Replaced CC_MD5_Init with CC_SHA256_Init
  • Replaced CC_MD5_Update with CC_SHA256_Update
  • Replaced CC_MD5_Final with CC_SHA256_Final
  • Updated digest length from CC_MD5_DIGEST_LENGTH to CC_SHA256_DIGEST_LENGTH

Notes

This change only affects the hashing algorithm used when generating cache keys for long cache key strings. The overall cache key generation logic remains unchanged, although the resulting hash values will differ from those generated using MD5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant