summaryrefslogtreecommitdiff
path: root/src/tools/tor-gencert.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-08-21 12:14:00 -0400
committerNick Mathewson <nickm@torproject.org>2014-08-21 12:14:00 -0400
commita8cc41a2303b9f6c8cffa6b69cd759760d91226e (patch)
treeb2ea640cf66dff29384314784c03577f19dfcd61 /src/tools/tor-gencert.c
parent916fba2243f36dcf53b078a95ce2389a63b94f72 (diff)
parent523587a5cf62119baa01822e2e783925726a790b (diff)
downloadtor-a8cc41a2303b9f6c8cffa6b69cd759760d91226e.tar.gz
tor-a8cc41a2303b9f6c8cffa6b69cd759760d91226e.zip
Merge branch 'coverity_20140821'
Diffstat (limited to 'src/tools/tor-gencert.c')
-rw-r--r--src/tools/tor-gencert.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tools/tor-gencert.c b/src/tools/tor-gencert.c
index e799df5cad..fae26ef956 100644
--- a/src/tools/tor-gencert.c
+++ b/src/tools/tor-gencert.c
@@ -134,18 +134,30 @@ parse_commandline(int argc, char **argv)
fprintf(stderr, "No argument to -i\n");
return 1;
}
+ if (identity_key_file) {
+ fprintf(stderr, "Duplicate values for -i\n");
+ return -1;
+ }
identity_key_file = tor_strdup(argv[++i]);
} else if (!strcmp(argv[i], "-s")) {
if (i+1>=argc) {
fprintf(stderr, "No argument to -s\n");
return 1;
}
+ if (signing_key_file) {
+ fprintf(stderr, "Duplicate values for -s\n");
+ return -1;
+ }
signing_key_file = tor_strdup(argv[++i]);
} else if (!strcmp(argv[i], "-c")) {
if (i+1>=argc) {
fprintf(stderr, "No argument to -c\n");
return 1;
}
+ if (certificate_file) {
+ fprintf(stderr, "Duplicate values for -c\n");
+ return -1;
+ }
certificate_file = tor_strdup(argv[++i]);
} else if (!strcmp(argv[i], "-m")) {
if (i+1>=argc) {