~ecryptfs/ecryptfs/trunk

« back to all changes in this revision

Viewing changes to src/libecryptfs/main.c

  • Committer: Dustin Kirkland
  • Date: 2015-03-26 22:58:46 UTC
  • mfrom: (851.2.2 reject-empty-passphrases)
  • Revision ID: dustin.kirkland@gmail.com-20150326225846-9rys1hwep5bv7zrk
Tags: 107
  - Reject empty passphrases passed into ecryptfs_wrap_passphrase()
* src/libecryptfs/main.c:
  - Reject empty wrapping passphrases passed into generate_passphrase_sig()

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
        int rc = 0;
225
225
 
226
226
        passphrase_size = strlen(passphrase);
227
 
        if (passphrase_size > ECRYPTFS_MAX_PASSPHRASE_BYTES) {
 
227
        if (passphrase_size < 1 ||
 
228
            passphrase_size > ECRYPTFS_MAX_PASSPHRASE_BYTES) {
228
229
                passphrase_sig = NULL;
229
 
                syslog(LOG_ERR, "Passphrase too large (%d bytes)\n",
230
 
                       passphrase_size);
 
230
                syslog(LOG_ERR, "Passphrase size is invalid; [1] to [%d] is the valid range\n",
 
231
                       ECRYPTFS_MAX_PASSPHRASE_BYTES);
231
232
                return -EINVAL;
232
233
        }
233
234
        memcpy(salt_and_passphrase, salt, ECRYPTFS_SALT_SIZE);