added X509_verify(cert, serverPubKey)#3861
Merged
marinofaggiana merged 3 commits intomasterfrom Nov 10, 2025
Merged
Conversation
Member
marinofaggiana
commented
Nov 4, 2025
- added E2EE X509_verify
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
alperozturk96
approved these changes
Nov 10, 2025
There was a problem hiding this comment.
I created certificate from Android and tested on iOS, certificate verification working.
@marinofaggiana You can check my optional suggestion for code changes.
| if error == .success, let publicKey { | ||
|
|
||
| // Verify Certificate | ||
| var verifyCertificate: Bool = false |
There was a problem hiding this comment.
This logic can be deduplicated for createNewE2EE and getPrivateKeyCipher.
Function:
private func verifyCertificate(_ account: String, _ publicKey: String) -> Bool {
var result = false
if let certificate = NCPreferences().getEndToEndCertificate(account: account) {
result = NCEndToEndEncryption.shared().verifyCertificate(certificate, publicKey: publicKey)
}
if result == false {
let error = NKError(
errorCode: NCGlobal.shared.errorInternalError,
errorDescription: "Serious internal error to verify certificate")
NCContentPresenter().messageNotification(
"E2E verify certificate server", error: error, delay: NCGlobal.shared.dismissAfterSecond,
type: NCContentPresenter.messageType.error, priority: .max)
}
return result
}
Usage in createNewE2EE and getPrivateKeyCipher.:
if error == .success, let publicKey {
let verifyCertificate = self.verifyCertificate(account, publicKey)
if !verifyCertificate {
return
}
NCPreferences().setEndToEndPublicKey(account: account, publicKey: publicKey)
NCManageDatabase.shared.clearTablesE2EE(account: account)
self.delegate?.endToEndInitializeSuccess(metadata: self.metadata)
}
Member
Author
|
Thanks for your suggestion but this class needs to be totally rewritten in asyn when I have time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.