openwallet-foundation/credo-ts

Version 0.5.3 crash iOS on credentials acceptance

icc-romeu opened this issue · 2 comments

Hi,

We have been working with version 0.4.x of CredoJS and now we want to move to 0.5.3. It works initially but when trying to accept a new indy credential we got a crash on iOS -Bad access- on the anoncreds native side exactly here:

jsi::Value createLinkSecret(jsi::Runtime &rt, jsi::Object options) {
  const char *out;

  ErrorCode code = anoncreds_create_link_secret(&out);

  return createReturnValue(rt, code, &out);
};

We solved it exactly as aries bifold does, creating it at startup. I have no idea why we do this but it works. For reference, is this code: https://github.com/openwallet-foundation/bifold-wallet/blob/6115b21ad5aff0e506e054abe88d0e4a26e8c277/packages/legacy/core/App/utils/agent.ts#L101

But now, we get another "bad access" crash when accepting credentials related to the same native code, but another function:

jsi::Value generateNonce(jsi::Runtime &rt, jsi::Object options) {
  const char *out;

  ErrorCode code = anoncreds_generate_nonce(&out);

  return createReturnValue(rt, code, &out);
};

I have no idea of why this crashes, but I assume we may need to initialise something.

We've seen this issue several times, and it always ended up being because there's another dependency that also loads OpenSLL. 0.5 updated to the new AnonCreds CL Sigantures library, and we use OpenSSL 3.

Dependencies we've encountered that caused issed:

Thank you so much @TimoGlastra ! Yes, it did the trick! we have react-native-quick-crypto installed, we are using it for other encryption issues, and in the last stable version it forces iOS to stick to this version:

  pod "OpenSSL-Universal", "~> 1.1.2200"

Removed it, updated to last RC and now it works like charm.