Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mz_crypt_apple.c references non-public symbols #708

Closed
huven opened this issue Jun 4, 2023 · 14 comments
Closed

mz_crypt_apple.c references non-public symbols #708

huven opened this issue Jun 4, 2023 · 14 comments
Labels
platform specific Issue only affects a specific platform

Comments

@huven
Copy link
Contributor

huven commented Jun 4, 2023

Just upgraded minizip-ng to 4.0.0 in my iOS app. Uploading it to Apple fails with error

The app references non-public symbols in Payload/[...]:
_CCCryptorGCMAddAAD, _CCCryptorGCMAddIV, _CCCryptorGCMDecrypt,
_CCCryptorGCMEncrypt, _CCCryptorGCMFinal (ID:
03667ee6-51bf-479f-b8b8-3c6253e65a3a)

The new section at the top of mz_crypt_apple.c copies declarations of CCCryptorGCMAddAAD etc.

Using private API blocks using this library in iOS/macOS apps.

@nmoinvaz
Copy link
Member

nmoinvaz commented Jun 4, 2023

If you want to add ifdef in those functions for iOS then I can accept PR. Just return MZ_SUPPORT_ERR;

@NickBrighten
Copy link
Contributor

Just upgraded minizip-ng to 4.0.0 in my iOS app. Uploading it to Apple fails with error

The app references non-public symbols in Payload/[...]: _CCCryptorGCMAddAAD, _CCCryptorGCMAddIV, _CCCryptorGCMDecrypt, _CCCryptorGCMEncrypt, _CCCryptorGCMFinal (ID: 03667ee6-51bf-479f-b8b8-3c6253e65a3a)

The new section at the top of mz_crypt_apple.c copies declarations of CCCryptorGCMAddAAD etc.

Using private API blocks using this library in iOS/macOS apps.

Is this also happened when you build a framework based on minizip-ng and using the framework instead of the source code of minizip-ng in your app???

@huven
Copy link
Contributor Author

huven commented Jun 4, 2023 via email

@NickBrighten
Copy link
Contributor

NickBrighten commented Jun 4, 2023

The implementation of CCCryptorStatus in minizip-ng (mz_crypt_apple) uses private API methods that don't go through the Apple review process...

API methods to use would be:
CCCryptorStatus CCCryptorCreateFromData
CCCryptorStatus CCCryptorCreate
CCCryptorStatus CCCryptorCreateFromDataWithMode
CCCryptorStatus CCCryptorCreateWithMode
CCCryptorStatus CCCryptorRelease
CCCryptorStatus CCCryptorUpdate
CCCryptorStatus CCCryptorFinal
CCCryptorStatus CCCryptorReset
CCCryptorStatus CCCryptorGetIV
CCCryptorStatus CCCrypt
CCCryptorStatus CCCryptorEncryptDataBlock
CCCryptorStatus CCCryptorDecryptDataBlock

Everything is fine in minizip-ng version 3.0.10 because official API methods are used.

@huven
Copy link
Contributor Author

huven commented Jun 4, 2023 via email

@huven
Copy link
Contributor Author

huven commented Jun 4, 2023 via email

@NickBrighten
Copy link
Contributor

The problem is the method "getRealCryptor" in "CommonCryptorGCM.c" - that is an private method and in "mz_crypt_apple.c" their will be used with "CCCryptorGCMAddAAD" and more...

@nmoinvaz
Copy link
Member

nmoinvaz commented Jun 4, 2023

Only the functions I had to declare at the top are private. Using ifdef are fine and it will just not support GCM on iOS. Zip format itself doesn't need it. It is just such for completeness if anybody wants to use classes for other purposes. I don't know if any other native functions for it on macOS/iOS that don't require swift or objective C.

@nmoinvaz
Copy link
Member

nmoinvaz commented Jun 4, 2023

Btw it is possible to notarize a macOS app linking to these functions. It could be a function of submitting it to AppStore and not a function of notarization.

@huven
Copy link
Contributor Author

huven commented Jun 5, 2023

Thanks, I will give the ifdef approach a try on the next app update (both iOS and mac Catalyst), if the app is accepted I will send the PR. This will probably take two weeks. I will report back here.

@NickBrighten
Copy link
Contributor

Only the functions I had to declare at the top are private.

That's not true - you define it above, but use it for the first time in the code starting at line 228...

What's the point of implementing GCM for ZIP if ZIP doesn't require it?

There are also other libraries for AES encoding and decoding that can do far more than GCM...

@nmoinvaz
Copy link
Member

nmoinvaz commented Jun 8, 2023

That's not true - you define it above, but use it for the first time in the code starting at line 228...

The function names are the same.

What's the point of implementing GCM for ZIP if ZIP doesn't require it?

I use it for another project.

There are also other libraries for AES encoding and decoding that can do far more than GCM...

Thanks, but I'm not interested in those other projects.

Like I said, I am open to PR. If not you can go back to using older version. That is why the change in version from 3.x to 4.x, because there is likely to be some breakage. Or you can use another ZIP library if you don't like the way I manage this one.

@nmoinvaz nmoinvaz added the platform specific Issue only affects a specific platform label Jun 11, 2023
@Coeur
Copy link
Contributor

Coeur commented Oct 23, 2024

I may have broke it again with #804.
I wanted the private api disabled by default, and I mistakenly made it enabled by default.
So anyone, feel free to propose a pull request with:

#define MZ_TARGET_APPSTORE 1

Alternatively, you will need to define MZ_TARGET_APPSTORE in all your apps.

@Coeur
Copy link
Contributor

Coeur commented Oct 23, 2024

Ah, never mind, already fixed in b2691a0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform specific Issue only affects a specific platform
Projects
None yet
Development

No branches or pull requests

4 participants