Skip to content

CC_MD5 deprecation migration #415

Open
@safaiyeh

Description

@safaiyeh

Current behavior

Currently Async Storage iOS relies on RCTMD5Hash which uses CC_MD5 to create a file hash https://github.com/react-native-community/async-storage/blob/af2664e5334175a180d71e22fe10e184904d63ff/ios/RNCAsyncStorage.m#L365

CC_MD5 was deprecated in iOS 13 due to not being cryptographically correct.

'CC_MD5' is deprecated: first deprecated in macOS 10.15 - This function is cryptographically broken and should not be used in security contexts. Clients should migrate to SHA256 (or stronger).

This initially brought up in React Native core, facebook/react-native#29590

Expected behavior

Either migrate to a SHA256 encryption or use a cryptographically correct MD5 hash package.

I'm assuming a SHA256 encryption would be better as it won't introduce a new dependency. This might be just a change in React Native core, unless it would be better for Async Storage to own that functionality.

I'll make the PR for these, just want to confirm which direction is best to go.

Repro steps

Build React Native app with async-storage & targeting iOS 13.

'CC_MD5' is deprecated: first deprecated in macOS 10.15 - This function is cryptographically broken and should not be used in security contexts. Clients should migrate to SHA256 (or stronger).

Warning should show up.

Environment

  • Async Storage version: 1.11.0
  • React-Native version: 0.63
  • Platform tested: iOS
  • Logs/Error that are relevant: N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions