π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Improve check
Neeraj Guptafd5a1ae3271b
diff --git a/server/pkg/utils/crypto/crypto.go b/server/pkg/utils/crypto/crypto.goindex df225b16fe..d659ba1989 100644--- a/server/pkg/utils/crypto/crypto.go+++ b/server/pkg/utils/crypto/crypto.go@@ -41,7 +41,11 @@ func encryptWithNonce(data string, encryptionKey []byte, nonce []byte) (ente.Enclogrus.WithField("op", "crypto_compare").WithError(err).Error("native encryption failed")return ente.EncryptionResult{}, stacktrace.Propagate(err, "native encryption failed")}- if nativeEnc.Cipher != nil && base64.StdEncoding.EncodeToString(nativeEnc.Cipher) != base64.StdEncoding.EncodeToString(encryptedEmailBytes) {+ if nativeEnc.Cipher == nil {+ return ente.EncryptionResult{}, stacktrace.NewError("native encryption returned nil cipher")+ }+ if base64.StdEncoding.EncodeToString(nativeEnc.Cipher) != base64.StdEncoding.EncodeToString(encryptedEmailBytes) ||+ base64.StdEncoding.EncodeToString(nativeEnc.Nonce) != base64.StdEncoding.EncodeToString(nonce) {logrus.WithField("op", "crypto_compare").Error("encryption mismatch between libsodium and native implementation")return ente.EncryptionResult{}, stacktrace.Propagate(err, "encryption mismatch")}