Skip to content

Add OAEP notification encryption - #4103

Merged
mpivchev merged 2 commits into
masterfrom
oaep-notifs
May 15, 2026
Merged

Add OAEP notification encryption#4103
mpivchev merged 2 commits into
masterfrom
oaep-notifs

Conversation

@mpivchev

@mpivchev mpivchev commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Implements: nextcloud/files-clients#124

First tries to decrypt with RSA PKCS#1 v1.5, then OAEP.

Tested on local instance with both encryption methods.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates push-notification payload decryption to support RSA OAEP in addition to the existing RSA PKCS#1 v1.5 scheme, aligning the iOS client with the “OAEP notification encryption” feature request.

Changes:

  • Attempt RSA PKCS#1 v1.5 decryption first, then fall back to RSA OAEP decryption.
  • Treat non-UTF8 decrypted bytes as a decryption failure and retry with OAEP.
Comments suppressed due to low confidence (1)

iOSClient/PushNotification/NCPushNotificationEncryption.m:135

  • The cleanup at the end uses free(bio) and free(rsa), but these are OpenSSL-allocated types that should be released with the matching OpenSSL APIs (e.g., BIO_free and RSA_free / EVP_PKEY_free). Using free() here can leak internal allocations and can be unsafe across OpenSSL builds. Also consider freeing the EVP_PKEY *pkey you created earlier to avoid leaking it on success.
    if (decrypted)
        free(decrypted);
    free(bio);
    free(rsa);
    

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread iOSClient/PushNotification/NCPushNotificationEncryption.m Outdated
Comment thread iOSClient/PushNotification/NCPushNotificationEncryption.m
Comment thread iOSClient/PushNotification/NCPushNotificationEncryption.m Outdated
Signed-off-by: Milen Pivchev <[email protected]>
@mpivchev

Copy link
Copy Markdown
Collaborator Author

@marinofaggiana pls check and approve

@mpivchev
mpivchev merged commit cb7e4b9 into master May 15, 2026
5 checks passed
@mpivchev
mpivchev deleted the oaep-notifs branch May 15, 2026 15:15
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.

4 participants