Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/crypto/external/bsd/netpgp/dist/src Remove a useless loop ar...
details: https://anonhg.NetBSD.org/src/rev/440bb851a263
branches: trunk
changeset: 351610:440bb851a263
user: khorben <khorben%NetBSD.org@localhost>
date: Mon Feb 20 01:38:28 2017 +0000
description:
Remove a useless loop around getpass()
According to getpass(3), this library function cannot return NULL.
Verified with a source code inspection.
diffstat:
crypto/external/bsd/netpgp/dist/src/lib/netpgp.c | 10 +++-------
crypto/external/bsd/netpgp/dist/src/librsa/rsastubs.c | 4 +---
2 files changed, 4 insertions(+), 10 deletions(-)
diffs (43 lines):
diff -r b3962d3087c6 -r 440bb851a263 crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c Mon Feb 20 01:34:53 2017 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c Mon Feb 20 01:38:28 2017 +0000
@@ -34,7 +34,7 @@
#if defined(__NetBSD__)
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: netpgp.c,v 1.98 2016/06/28 16:34:40 christos Exp $");
+__RCSID("$NetBSD: netpgp.c,v 1.99 2017/02/20 01:38:28 khorben Exp $");
#endif
#include <sys/types.h>
@@ -740,14 +740,10 @@
}
for (i = 0 ; i < attempts ; i++) {
(void) snprintf(prompt, sizeof(prompt), "Enter passphrase for %.16s: ", id);
- if ((cp = getpass(prompt)) == NULL) {
- break;
- }
+ cp = getpass(prompt);
cc = snprintf(buf, sizeof(buf), "%s", cp);
(void) snprintf(prompt, sizeof(prompt), "Repeat passphrase for %.16s: ", id);
- if ((cp = getpass(prompt)) == NULL) {
- break;
- }
+ cp = getpass(prompt);
cc = snprintf(passphrase, size, "%s", cp);
if (strcmp(buf, passphrase) == 0) {
(void) memset(buf, 0x0, sizeof(buf));
diff -r b3962d3087c6 -r 440bb851a263 crypto/external/bsd/netpgp/dist/src/librsa/rsastubs.c
--- a/crypto/external/bsd/netpgp/dist/src/librsa/rsastubs.c Mon Feb 20 01:34:53 2017 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/librsa/rsastubs.c Mon Feb 20 01:38:28 2017 +0000
@@ -43,9 +43,7 @@
USE_ARG(rwflag);
snprintf(prompt, sizeof(prompt), "\"%s\" passphrase: ", (char *)u);
- if ((passphrase = getpass(prompt)) == NULL) {
- return -1;
- }
+ passphrase = getpass(prompt);
(void) memcpy(buf, passphrase, (size_t)size);
return (int)strlen(passphrase);
}
Home |
Main Index |
Thread Index |
Old Index