ceanup encryption code, improved return codes
Merge pull request #8676 from owncloud/encryption_improvements

cleanup encryption code, improved return codes