Skip to content

Commit

Permalink
Merge pull request #198 from Tarsnap/stdin-no-P
Browse files Browse the repository at this point in the history
Cannot combine -P with infile=stdin
  • Loading branch information
cperciva committed Aug 15, 2019
2 parents df116c4 + 6122697 commit 0e7fc3d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions main.c
Expand Up @@ -162,6 +162,13 @@ main(int argc, char *argv[])
}
} else {
infile = stdin;

/* Error if given incompatible options. */
if (devtty == 0) {
warn0("Cannot read both passphrase and input file"
" from standard input");
goto err0;
}
}

/* Prompt for a password. */
Expand Down
4 changes: 3 additions & 1 deletion scrypt.1
Expand Up @@ -89,7 +89,9 @@ Use at most
seconds of CPU time to compute the derived encryption key.
.It Fl P
Always read passphrase from stdin, and do so only once even
when encrypting.
when encrypting. This cannot be used if
.Ar infile
is also stdin (aka '-').
.It Fl -version
Print version of scrypt, and exit.
.El
Expand Down

0 comments on commit 0e7fc3d

Please sign in to comment.