core icon indicating copy to clipboard operation
core copied to clipboard

ownCloud encryption not working with Notes App

Open maltefiala opened this issue 12 years ago • 37 comments

We are getting a lot of feedback concerning encryption not working in ownCloud Notes. As suggested by @Raydiation I hereby open this one in core. Please everyone out there:

  • check your SSL Keychain before testing this issue
  • give us as much feedback as possible on this

Dependent Issues

  • owncloud/notes#48
  • https://github.com/aykit/myownnotes-android/issues/35

Core Devs It would be great if you could comment on this.

Thanks.

maltefiala avatar Jul 02 '14 21:07 maltefiala

@schiesbn Can you test?

karlitschek avatar Jul 02 '14 21:07 karlitschek

I run an encrypted ownCloud. The Notes app is installed and enabled. Accessing the url /index.php/apps/notes/api/v0.2/notes gives me the contents. Trying to access with the myownnotes from Android generates an error "There was a connection error. Please check your username / password". The log contains the following: XXX - xxx [02/Jul/2014:21:08:15 +0000] "GET /index.php/apps/notes/api/v0.2/notes HTTP/1.1" 302 1599 "-" "Dalvik/1.6.0 (Linux; U; Android 4.2.2; A1-810 Build/JDQ39)" XXX - xxx [02/Jul/2014:21:08:16 +0000] "GET /apps/files_encryption/files/error.php?p=0&errorCode=1 HTTP/1.1" 403 2510 "-" "Dalvik/1.6.0 (Linux; U; Android 4.2.2; A1-810 Build/JDQ39)"

SSL keychain for the https connection? I have a RapidSSL cert, installed in Apache and intermediate cert in the config as well. Seems to work fine.

tigrino avatar Jul 02 '14 21:07 tigrino

Oh man, that issue....

@Raydiation: Is owncloud/notes#48 still unresolved? @tigrino says the API is working fine. A quick check on our testmachine gave us the impression that the app is working too with ownCloud encryption enabled (https://github.com/aykit/myownnotes-android/issues/35).

However, I have no idea (nor time to look at atm) how ownCloud implemented encryption. It would be great if we could figure out if owncloud/notes#48 is solved and the app is the only "weak" link here.

Questions

  • What is the best way to test an encrypted ownCloud setting with API and the app?
  • How can I make sure, my ownCloud instance is encrypted?
  • Is it important what app is being installed first (Notes or Encryption)? We should test all possibilities....
  • Is it important to use a recovery key?

maltefiala avatar Jul 02 '14 22:07 maltefiala

@tigrino : Please use https://www.ssllabs.com/ssltest/ to test your chain. Additionally, it would be great if you could test it with encryption disabled as well. Just to make sure... and please provide us with every step you take ;)

maltefiala avatar Jul 02 '14 22:07 maltefiala

@maltemafia Can you try it with the newest beta of 7? Works for me

BernhardPosselt avatar Jul 03 '14 05:07 BernhardPosselt

Mmm... Taking the server offline and replacing it with a fresh instance to check the working without/with encryption may be possible but I would rather avoid doing that if possible... Mine is encryption first, long time ago, notes installed yesterday.

Call to the API (/index.php/apps/notes/api/v0.2/notes) returns this: [{"modified":1404366591,"title":"Hello, world!","content":"Hello, world!","id":44061}]

The file on disk is encrypted and contains this: FnI7GrzEBZWUaETq+A==00iv00qrBKD5IemmX9hIbzx

ssllabs check reports all ok with the certificate except for limited support for forward secrecy. Do you want the complete report here?

tigrino avatar Jul 03 '14 05:07 tigrino

That would be great. But if you don't want to share it, just report this:

Additional Certificates (if supplied)

Certificates provided x (z bytes) Chain issues REPORT THIS FIELD

maltefiala avatar Jul 03 '14 07:07 maltefiala

@Raydiation : My colleague is testing 6.0.4 today and I will test 7 later on. Btw, my name is maltefiala, not to be confused with some mafia :)

@tigrino : What server version of ownCloud are you running?

maltefiala avatar Jul 03 '14 07:07 maltefiala

My colleague @steppenhahn made various tests today. From our point of view, encryption seems to be the problem.

My Own Notes works like a charm with the encryption-plugin disabled. As soon as we activate the encryption-plugin, we get an 403 error and the following exception:

java.io.FileNotFoundException: https://myserver.com/owncloud/apps/files_encryption/files/error.php?p=0&errorCode=1

it does not matter if the encryption is disabled or enabled (admin-tab) - If the plugin is enabled, myownnotes does not work.

System tested

  • ownCloud Server Version 6.0.4
  • Notes Version: 0.9
  • Encryption-Plugin-version: 0.5

Next Steps

We will investigate this issue on 7.0 this weekend.

maltefiala avatar Jul 03 '14 11:07 maltefiala

Try to log out after enabling encryption. The error code in the URL means that encryption is not yet initialized

BernhardPosselt avatar Jul 03 '14 11:07 BernhardPosselt

@maltefiala

Additional Certificates (if supplied) Certificates provided 2 (2295 bytes) Chain issues None

ownCloud 6.0.4 (stable)

tigrino avatar Jul 03 '14 20:07 tigrino

@Raydiation I run for several months already on this version and with encryption enabled. I just installed notes and ran into problems, encryption was there before and is working fine.

tigrino avatar Jul 03 '14 20:07 tigrino

The chain looks good then. I will investigate further on the weekend.

ramschmaerchen avatar Jul 03 '14 21:07 ramschmaerchen

I came to the same conclusion as maltefiala: it must have to do with the encryption. My nginx-access.log reports [...] GET /owncloud/index.php/apps/notes/api/v0.2/notes HTTP/1.1" 302 5 "-" "Dalvik/1.6.0 (Linux; U; Android 4.1.2; GT-I8160 Build/JZO54K)" [...] GET /owncloud/ HTTP/1.1" 200 3017 "-" "Wget/1.14 (linux-gnu)" [...] GET /owncloud/apps/files_encryption/files/error.php?p=0&errorCode=1 HTTP/1.1" 403 2094 "-" "Dalvik/1.6.0 (Linux; U; Android 4.1.2; GT-I8160 Build/JZO54K)" when MyOwnNotes tries to refresh and it reports "There was a connection error. Please check your username and password.". I hope that helps, because I lost all my notes a moment ago.

urenzel avatar Jul 06 '14 23:07 urenzel

@urenzel i am really sorry that you lost your notes. :( had this bug too and it was tricky to find. but i fixed it in version 1.2.2

@Raydiation tried logging out - still doesn't work.

here is exactly what i did:

  • login
  • make sure encryption plugin is disabled.
  • logout

now myownnotes can connect properly - no errors

then:

  • login
  • enable encryption plugin.
  • logout

now myownnotes can NOT connect. see error message from maltefiala (waiting 5 min. after logout does not change outcome)

then:

  • login
  • enable encryption recovery key + enter key.
  • logout

same problem as above

System tested:

  • ownCloud Server Version 6.0.4
  • Notes Version: 0.9
  • Encryption-Plugin-version: 0.5

steppenhahn avatar Jul 07 '14 11:07 steppenhahn

Just for clarification https://github.com/owncloud/notes/issues/48 is not solved. I spent the entire weekend working on this without a solution. It's a high priority for users.

phedlund avatar Jul 07 '14 15:07 phedlund

This issue is really a duplicate of https://github.com/owncloud/core/issues/8830.

phedlund avatar Jul 07 '14 16:07 phedlund

With the new release, 1.3.1, I get a different message in the log file: x.x.x.x - guest [19/Jul/2014:19:29:21 +0000] "GET /index.php/apps/notes/api/v0.2/notes HTTP/1.1" 401 956 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; D5503 Build/14.2.A.1.114)"

Accessing the URL directly in the browser returns the expected [{"modified":1404366591,"title":"Hello, world!","content":"Hello, world!","id":44061}]

tigrino avatar Jul 19 '14 19:07 tigrino

Nope, back to the original errors. x.x.x.x - guest [11/Aug/2014:11:10:53 +0000] "GET /index.php/apps/notes/api/v0.2/notes HTTP/1.1" 302 1619 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; D5503 Build/14.2.A.1.114)" x.x.x.x - guest [11/Aug/2014:11:10:54 +0000] "GET /apps/files_encryption/files/error.php?p=0&errorCode=1 HTTP/1.1" 403 2287 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; D5503 Build/14.2.A.1.114)"

tigrino avatar Aug 11 '14 11:08 tigrino

Sry, we are in a summer limbo atm. We will try to find a solution in September.

ramschmaerchen avatar Aug 12 '14 08:08 ramschmaerchen