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

« back to all changes in this revision

Viewing changes to src/utils/ecryptfs_rewrap_passphrase.c

  • Committer: Bazaar Package Importer
  • Author(s): Dustin Kirkland, Paolo Bonzini, Dustin Kirkland
  • Date: 2011-03-09 13:31:29 UTC
  • mfrom: (1.1.32 upstream)
  • Revision ID: james.westby@ubuntu.com-20110309133129-m1ew1it62z0fatm7
Tags: 87-0ubuntu1
[ Paolo Bonzini <pbonzini@redhat.com> ]
* src/utils/ecryptfs-setup-private: update the Private.* selinux
  contexts

[ Dustin Kirkland ]
* src/utils/ecryptfs-setup-private:
  - add -p to mkdir, address noise for a non-error
  - must insert keys during testing phase, since we remove keys on
    unmount now, LP: #725862
* src/utils/ecryptfs_rewrap_passphrase.c: confirm passphrases in
  interactive mode, LP: #667331

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
        char passphrase[ECRYPTFS_MAX_PASSWORD_LENGTH + 1];
43
43
        char *old_wrapping_passphrase;
44
44
        char *new_wrapping_passphrase;
 
45
        char *new_wrapping_passphrase2;
45
46
        char salt[ECRYPTFS_SALT_SIZE];
46
47
        char salt_hex[ECRYPTFS_SALT_SIZE_HEX];
47
48
        int rc = 0;
52
53
                        ecryptfs_get_passphrase("Old wrapping passphrase");
53
54
                new_wrapping_passphrase =
54
55
                        ecryptfs_get_passphrase("New wrapping passphrase");
 
56
                new_wrapping_passphrase2 =
 
57
                        ecryptfs_get_passphrase("New wrapping passphrase (again)");
 
58
                if (
 
59
                    strlen(new_wrapping_passphrase) != strlen(new_wrapping_passphrase2) ||
 
60
                    strncmp(new_wrapping_passphrase, new_wrapping_passphrase2, strlen(new_wrapping_passphrase))!=0
 
61
                   ) {
 
62
                        fprintf(stderr, "New wrapping passphrases do not match\n");
 
63
                        rc = 1;
 
64
                        goto out;
 
65
                }
55
66
        } else if (argc == 3
56
67
                   && strlen(argv[2]) == 1 && strncmp(argv[2], "-", 1) == 0) {
57
68
                /* stdin mode */