~ubuntu-branches/ubuntu/lucid/ecryptfs-utils/lucid-security

« back to all changes in this revision

Viewing changes to src/utils/ecryptfs_unwrap_passphrase.c

  • Committer: Bazaar Package Importer
  • Author(s): Dustin Kirkland, Dustin Kirkland, Tyler Hicks, Michal Hlavinka, anrxc & Dustin Kirkland, Daniel Baumann & Dustin Kirkland, Arfrever Frehtes Taifersar Arahesis, Frédéric Guihéry
  • Date: 2009-05-02 11:44:56 UTC
  • mfrom: (1.1.20 upstream)
  • Revision ID: james.westby@ubuntu.com-20090502114456-x714at0k2jxgmwae
Tags: 75-0ubuntu1
[ Dustin Kirkland ]
* debian/rules: drop hackery that moves stuff /usr/share/ecryptfs-utils
* src/utils/mount.ecryptfs_private.c: update inline documentation
* debian/changelog, src/libecryptfs/cmd_ln_parser.c,
  src/libecryptfs/key_management.c, src/pam_ecryptfs/pam_ecryptfs.c,
  src/utils/ecryptfs_add_passphrase.c,
  src/utils/ecryptfs_insert_wrapped_passphrase_into_keyring.c,
  src/utils/ecryptfs_rewrap_passphrase.c,
  src/utils/ecryptfs_unwrap_passphrase.c,
  src/utils/ecryptfs_wrap_passphrase.c: silence some useless logging,
  LP: #313330
* include/ecryptfs.h, libecryptfs/key_management.c,
  utils/ecryptfs_insert_wrapped_passphrase_into_keyring.c,
  utils/ecryptfs_unwrap_passphrase.c: if the file to unwrap is
  unspecified, try to use the default ~/.ecryptfs/wrapped-passphrase
  before bailing out, LP: #359997
* src/utils/ecryptfs-setup-private: unix_chkpwd is not always present
  (eg, gentoo), LP: #332341

[ Tyler Hicks ]
* doc/manpage/ecryptfs.7: ecryptfs_encrypted_view option desription
  was wrong LP: #328761

[ Michal Hlavinka ]
* decision_graph.c: fix uninitialized return code
* mount.ecryptfs.c: don't pass verbosity option to kernel

[ anrxc & Dustin Kirkland ]
* doc/Makefile.am, src/desktop/Makefile.am: fix automake installation from
  /usr/share to /usr/share/ecryptfs-utils

[ Daniel Baumann & Dustin Kirkland ]
* debian/rules, debian/control: sync differences between Debian & Ubuntu's
  packaging

[ Arfrever Frehtes Taifersar Arahesis ]
* src/key_mod/ecryptfs_key_mod_gpg.c,
  src/key_mod/ecryptfs_key_mod_pkcs11_helper.c: fix implicit declations

[ Frédéric Guihéry ]
* key_mod/ecryptfs_key_mod_tspi.c, utils/ecryptfs_generate_tpm_key.c:
  the SRK password should be set to 20 bytes of NULL (wellknown
  password), in order for different tools to request key protection
  with the Storage Root Key

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
        char *wrapping_passphrase;
43
43
        char salt[ECRYPTFS_SALT_SIZE];
44
44
        char salt_hex[ECRYPTFS_SALT_SIZE_HEX];
 
45
        struct passwd *pwd;
45
46
        int rc = 0;
46
47
 
47
 
        if (argc == 2) {
 
48
        if (argc == 1) {
 
49
                /* interactive, and try default wrapped-passphrase file */
 
50
                file = ecryptfs_get_wrapped_passphrase_filename();
 
51
                if (file == NULL) {
 
52
                        usage();
 
53
                        goto out;
 
54
                }
 
55
                wrapping_passphrase = ecryptfs_get_passphrase("Passphrase");
 
56
        } else if (argc == 2) {
48
57
                /* interactive mode */
 
58
                file = argv[1];
49
59
                wrapping_passphrase = ecryptfs_get_passphrase("Passphrase");
50
60
        } else if (argc == 3 &&
51
61
                   strlen(argv[2]) == 1 && strncmp(argv[2], "-", 1) == 0) {
52
62
                /* stdin mode */
 
63
                file = argv[1];
53
64
                wrapping_passphrase = ecryptfs_get_passphrase(NULL);
54
65
        } else if (argc == 3 &&
55
66
                   (strlen(argv[2]) != 1 || strncmp(argv[2], "-", 1) == 0)) {
56
67
                /* argument mode */
 
68
                file = argv[1];
57
69
                wrapping_passphrase = argv[2];
58
70
        } else {
59
71
                usage();
65
77
                goto out;
66
78
        }
67
79
 
68
 
        file = argv[1];
69
80
        rc = ecryptfs_read_salt_hex_from_rc(salt_hex);
70
81
        if (rc) {
71
 
                fprintf(stderr, "%s\n", ECRYPTFS_WARN_DEFAULT_SALT);
72
82
                from_hex(salt, ECRYPTFS_DEFAULT_SALT_HEX, ECRYPTFS_SALT_SIZE);
73
83
        } else
74
84
                from_hex(salt, salt_hex, ECRYPTFS_SALT_SIZE);