From db1590def9a1b6289d9e328e722417d0181f8c5d Mon Sep 17 00:00:00 2001 From: root Date: Tue, 20 Feb 1996 06:02:32 +0000 Subject: [PATCH] passPhrase is passed as arg start writing getPassPhrase() CVS patchset: 351 CVS date: 1996/02/20 06:02:32 --- lib/signature.c | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/lib/signature.c b/lib/signature.c index 4468020..33331e4 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -3,7 +3,10 @@ /* NOTES * * A PGP 2.6.2 1024 bit key generates a 152 byte signature + * A ViaCryptPGP 2.7.1 1024 bit key generates a 152 byte signature * A PGP 2.6.2 768 bit key generates a 120 byte signature + * + * This code only only works with 1024 bit keys! */ #include @@ -17,7 +20,7 @@ #include "rpmlib.h" #include "rpmerr.h" -static int makePGPSignature(char *file, int ofd); +static int makePGPSignature(char *file, int ofd, char *passPhrase); static int verifyPGPSignature(int fd, void *sig, char *result); int readSignature(int fd, short sig_type, void **sig) @@ -42,26 +45,49 @@ int readSignature(int fd, short sig_type, void **sig) return 1; } -int makeSignature(char *file, short sig_type, int ofd) +int makeSignature(char *file, short sig_type, int ofd, char *passPhrase) { switch (sig_type) { case RPMSIG_NONE: /* Do nothing */ break; case RPMSIG_PGP262_1024: - makePGPSignature(file, ofd); + makePGPSignature(file, ofd, passPhrase); break; } return 1; } -static int makePGPSignature(char *file, int ofd) +#if 0 +void ttycbreak(void) +{ + int tty; + + if ((tty = open("/dev/tty", O_RDWR)) < 0) { + fprintf(stderr, "Unable to open tty. Using standard input.\n"); + tty = 0; + } + + +} + +char *getPassPhrase(char *prompt) +{ + if (prompt) { + puts(prompt); + } + + + +} +#endif + +static int makePGPSignature(char *file, int ofd, char *passPhrase) { char secring[1024]; char pubring[1024]; char name[1024]; - char *passPhrase = "This is a test."; char sigfile[1024]; int pid, status; int fd, inpipe[2]; -- 2.7.4