--- pgp/src/passwd.c 2018/04/24 16:41:07 1.1.1.5 +++ pgp/src/passwd.c 2018/04/24 16:45:35 1.1.1.8 @@ -2,7 +2,7 @@ Implemented in Microsoft C. Routines for getting a pass phrase from the user's console. - (c) Copyright 1990-1994 by Philip Zimmermann. All rights reserved. + (c) Copyright 1990-1996 by Philip Zimmermann. All rights reserved. The author assumes no liability for damages resulting from the use of this software, even if the damage results from defects in this software. No warranty is expressed or implied. @@ -28,6 +28,11 @@ #include "md5.h" #include "language.h" #include "pgp.h" +#include "charset.h" + +#ifdef AMIGA +# include "system.h" +#endif #define MAXKEYLEN 254 /* max byte length of pass phrase */ @@ -71,14 +76,21 @@ int GetHashedPassPhrase(char *hash, bool noecho = 0; for (;;) { fprintf(pgpout,LANG("\nEnter pass phrase: ")); +#ifdef AMIGA + requesterdesc=LANG("\nEnter pass phrase: "); +#endif getstring(keystr1,MAXKEYLEN-1,!noecho); if (noecho<2) /* no need to ask again if user can see it */ break; fprintf(pgpout,LANG("\nEnter same pass phrase again: ")); +#ifdef AMIGA + requesterdesc=LANG("\nEnter same pass phrase again: "); +#endif getstring(keystr2,MAXKEYLEN-1,!noecho); if (strcmp(keystr1,keystr2)==0) break; - fprintf(pgpout,LANG("\n\007Error: Pass phrases were different. Try again.")); + fprintf(pgpout, +LANG("\n\007Error: Pass phrases were different. Try again.")); memset(keystr2, 0, sizeof(keystr2)); } if (noecho && (filter_mode || quietmode)) @@ -87,10 +99,10 @@ int GetHashedPassPhrase(char *hash, bool len = strlen(keystr1); if (len == 0) return 0; - /* We assume ASCII pass phrases, with no charset conversions. */ - /* This will have to change for EBCDIC */ + CONVERT_TO_CANONICAL_CHARSET(keystr1); hashpass (keystr1, strlen(keystr1), (byte *) hash); memset(keystr1, 0, sizeof(keystr1)); + memset(keystr2, 0, sizeof(keystr2)); return 1; } /* GetHashedPassPhrase */