and manipulate the tty for readpassphrase, but once we've parsed options
and have some idea of what's going to happen next, we can reduce down
quite a bit more. particular use case of "signify | patch" is limited to
feeding garbage to patch.
-/* $OpenBSD: signify.c,v 1.100 2015/01/16 06:16:12 tedu Exp $ */
+/* $OpenBSD: signify.c,v 1.101 2015/10/08 16:45:50 tedu Exp $ */
/*
* Copyright (c) 2013 Ted Unangst <tedu@openbsd.org>
*
VERIFY
} verb = NONE;
+ if (tame("stdio rpath wpath cpath tty", NULL) == -1)
+ err(1, "tame");
rounds = 42;
argc -= optind;
argv += optind;
+ switch (verb) {
+ case GENERATE:
+ case SIGN:
+ /* keep it all */
+ break;
+ case CHECK:
+ if (tame("stdio rpath", NULL) == -1)
+ err(1, "tame");
+ break;
+ case VERIFY:
+ if (embedded && (!msgfile || strcmp(msgfile, "-") != 0)) {
+ if (tame("stdio rpath wpath cpath", NULL) == -1)
+ err(1, "tame");
+ } else {
+ if (tame("stdio rpath", NULL) == -1)
+ err(1, "tame");
+ }
+ break;
+ default:
+ if (tame("stdio", NULL) == -1)
+ err(1, "tame");
+ break;
+ }
+
#ifndef VERIFYONLY
if (verb == CHECK) {
if (!sigfile)