git-annex/Remote
Joey Hess 2f3c3aa01f glacier, S3: Fix bug that caused embedded creds to not be encypted using the remote's key.
encryptionSetup must be called before setRemoteCredPair. Otherwise,
the RemoteConfig doesn't have the cipher in it, and so no cipher is used to
encrypt the embedded creds.

This is a security fix for non-shared encryption methods!

For encryption=shared, there's no security problem, just an
inconsistentency in whether the embedded creds are encrypted.

This is very important to get right, so used some types to help ensure that
setRemoteCredPair is only run after encryptionSetup. Note that the external
special remote bypasses the type safety, since creds can be set after the
initial remote config, if the external special remote program requests it.
Also note that IA remotes never use encryption, so encryptionSetup is not
run for them at all, and again the type safety is bypassed.

This leaves two open questions:

1. What to do about S3 and glacier remotes that were set up
   using encryption=pubkey/hybrid with embedcreds?
   Such a git repo has a security hole embedded in it, and this needs to be
   communicated to the user. Is the changelog enough?

2. enableremote won't work in such a repo, because git-annex will
   try to decrypt the embedded creds, which are not encrypted, so fails.
   This needs to be dealt with, especially for ecryption=shared repos,
   which are not really broken, just inconsistently configured.

   Noticing that problem for encryption=shared is what led to commit
   fbdeeeed5f, which tried to
   fix the problem by not decrypting the embedded creds.

This commit was sponsored by Josh Taylor.
2014-09-18 17:26:12 -04:00
..
Directory pushed checkPresent exception handling out of Remote implementations 2014-08-06 13:45:19 -04:00
External unify exception handling into Utility.Exception 2014-08-07 22:03:29 -04:00
Helper glacier, S3: Fix bug that caused embedded creds to not be encypted using the remote's key. 2014-09-18 17:26:12 -04:00
Rsync rsync special remote: Fix slashes when used on Windows. 2014-03-18 13:02:10 -04:00
WebDAV WebDAV: Avoid buffering whole file in memory when downloading. 2014-08-08 13:40:55 -04:00
Bup.hs glacier, S3: Fix bug that caused embedded creds to not be encypted using the remote's key. 2014-09-18 17:26:12 -04:00
Ddar.hs glacier, S3: Fix bug that caused embedded creds to not be encypted using the remote's key. 2014-09-18 17:26:12 -04:00
Directory.hs glacier, S3: Fix bug that caused embedded creds to not be encypted using the remote's key. 2014-09-18 17:26:12 -04:00
External.hs glacier, S3: Fix bug that caused embedded creds to not be encypted using the remote's key. 2014-09-18 17:26:12 -04:00
GCrypt.hs glacier, S3: Fix bug that caused embedded creds to not be encypted using the remote's key. 2014-09-18 17:26:12 -04:00
Git.hs New annex.hardlink setting. Closes: #758593 2014-09-05 13:44:09 -04:00
Glacier.hs glacier, S3: Fix bug that caused embedded creds to not be encypted using the remote's key. 2014-09-18 17:26:12 -04:00
Hook.hs glacier, S3: Fix bug that caused embedded creds to not be encypted using the remote's key. 2014-09-18 17:26:12 -04:00
List.hs factor out getRemoteGitConfig 2014-05-16 16:08:20 -04:00
Rsync.hs glacier, S3: Fix bug that caused embedded creds to not be encypted using the remote's key. 2014-09-18 17:26:12 -04:00
S3.hs glacier, S3: Fix bug that caused embedded creds to not be encypted using the remote's key. 2014-09-18 17:26:12 -04:00
Tahoe.hs testremote: Add testing of behavior when remote is not available 2014-08-10 15:02:59 -04:00
Web.hs testremote: Add testing of behavior when remote is not available 2014-08-10 15:02:59 -04:00
WebDAV.hs glacier, S3: Fix bug that caused embedded creds to not be encypted using the remote's key. 2014-09-18 17:26:12 -04:00