better pass phrase handling, check for bad pass phrase
authorroot <devnull@localhost>
Thu, 22 Feb 1996 01:34:20 +0000 (01:34 +0000)
committerroot <devnull@localhost>
Thu, 22 Feb 1996 01:34:20 +0000 (01:34 +0000)
CVS patchset: 387
CVS date: 1996/02/22 01:34:20

rpm.c

diff --git a/rpm.c b/rpm.c
index 77d8d6f..9e588f7 100755 (executable)
--- a/rpm.c
+++ b/rpm.c
@@ -454,7 +454,12 @@ int main(int argc, char ** argv) {
     if (signIt) {
         if (bigMode == MODE_REBUILD || bigMode == MODE_BUILD) {
             if ((optind != argc) && (sigLookupType() == RPMSIG_PGP262_1024)) {
-               passPhrase = strdup(getPassPhrase("Enter pass phrase:"));
+               if (!(passPhrase = getPassPhrase("Enter pass phrase: "))) {
+                   fprintf(stderr, "Pass phrase check failed\n");
+                   exit(1);
+               } else {
+                   passPhrase = strdup(passPhrase);
+               }
            }
        } else {
            argerror("--sign may only be used during package building");