/[pkg-mixmaster]/trunk/Mix/Src/main.c
ViewVC logotype

Contents of /trunk/Mix/Src/main.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 512 - (show annotations) (download)
Thu May 8 18:07:08 2003 UTC (10 years ago) by weaselp
File MIME type: text/plain
File size: 19106 byte(s)
Experimental feature:  --redirect -l <chain>.  If you have a mixmaster message
with a chain starting with hop1 (you cannot know any more because it already is
encrypted) then mix --redirect -l=foo,bar < file redirect the message so the
chain is actually foo,bar,hop1,... and places it in your pool.  If the total
number of hops (which cannot be known) exceeds 20 the message is damanged and
will fail at the 20th node.
1 /* Mixmaster version 3 -- (C) 1999 Anonymizer Inc.
2
3 Mixmaster may be redistributed and modified under certain conditions.
4 This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
5 ANY KIND, either express or implied. See the file COPYRIGHT for
6 details.
7
8 Command-line based frontend
9 $Id: main.c,v 1.31 2003/05/08 18:07:08 weaselp Exp $ */
10
11
12 #include "mix3.h"
13 #include "pgp.h"
14 #include <stdio.h>
15 #include <string.h>
16 #include <ctype.h>
17 #include <stdlib.h>
18 #ifdef POSIX
19 #include <unistd.h>
20 #else /* end of POSIX */
21 #include <io.h>
22 #endif /* else if not POSIX */
23 #include <assert.h>
24
25 static char *largopt(char *p, char *opt, char *name, int *error);
26 static void noarg(char *name, char p);
27 static int check_get_pass(int force);
28
29 /** main *****************************************************************/
30
31 /* Returns:
32 0 successful operation
33 1 command line error
34 2 client error condition */
35
36 #ifdef WIN32SERVICE
37 int mix_main(int argc, char *argv[])
38 #else
39 int main(int argc, char *argv[])
40 #endif /* WIN32SERVICE */
41 {
42 int error = 0, deflt = 1, help = 0, readmail = 0, send = -1, sendpool = 0,
43 header = 1, maint = 0, keygen = 0, verbose = 2, sign = 0, encrypt = 0,
44 redirect_mail = 0;
45 int daemon = 0, type_list = 0, nodetach = 0;
46
47 #ifdef USE_SOCK
48 int pop3 = 0;
49
50 #endif /* USE_SOCK */
51 char *filename = NULL;
52 int i;
53 int ret = 0;
54 char *p, *q;
55 char chain[1024] = "";
56 char nym[LINELEN] = "";
57 BUFFER *nymopt, *pseudonym, *attachments;
58 int numcopies = 0; /* default value set in mix.cfg */
59 BUFFER *msg, *chainlist, *field, *content;
60 FILE *f;
61
62 /* Check if parse_yearmonthday works */
63 assert(parse_yearmonthday("2003-04-01") == 1049155200);
64
65 mix_init(NULL);
66
67 msg = buf_new();
68 chainlist = buf_new();
69 nymopt = buf_new();
70 pseudonym = buf_new();
71 attachments = buf_new();
72 field = buf_new();
73 content = buf_new();
74
75 #ifdef USE_NCURSES
76 if (argc == 1) {
77 if (isatty(fileno(stdin)))
78 menu_main();
79 else
80 menu_folder(0, NULL);
81 goto clientpool;
82 }
83 #endif /* USE_NCURSES */
84 if (argc > 1 && strleft(argv[1], "-f")) {
85 menu_folder(strlen(argv[1]) > 2 ? argv[1][2] : 0,
86 argc < 3 ? NULL : argv[2]);
87 goto clientpool;
88 }
89 for (i = 1; i < argc; i++) {
90 p = argv[i];
91 if (p[0] == '-' && p[1] != '\0') {
92 if (p[1] == '-') {
93 p += 2;
94 if (strieq(p, "help"))
95 help = 1, deflt = 0;
96 else if (streq(p, "verbose"))
97 verbose = 1;
98 else if (streq(p, "type-list"))
99 type_list = 1;
100 else if (streq(p, "dummy"))
101 send = MSG_NULL, deflt = 0;
102 else if (streq(p, "remailer"))
103 maint = 1, deflt = 0;
104 else if (streq(p, "generate-key"))
105 keygen = 2, deflt = 0;
106 else if (streq(p, "update-keys"))
107 keygen = 1, deflt = 0;
108 else if (streq(p, "send"))
109 sendpool = 1, deflt = 0;
110 else if (streq(p, "read-mail"))
111 readmail = 1, deflt = 0;
112 else if (streq(p, "redirect"))
113 redirect_mail = 1, deflt = 0;
114 else if (streq(p, "store-mail"))
115 readmail = 2, deflt = 0;
116 #ifdef USE_SOCK
117 else if (streq(p, "pop-mail"))
118 pop3 = 1, deflt = 0;
119 #endif /* USE_SOCK */
120 else if (streq(p, "daemon"))
121 daemon = 1, deflt = 0;
122 else if (streq(p, "no-detach"))
123 nodetach = 1;
124 else if (streq(p, "post"))
125 send = MSG_POST;
126 else if (streq(p, "mail"))
127 send = MSG_MAIL;
128 else if (streq(p, "sign"))
129 sign = 1;
130 else if (streq(p, "encrypt"))
131 encrypt = 1;
132 else if ((q = largopt(p, "to", argv[0], &error)) != NULL) {
133 header = 0;
134 buf_appendf(msg, "To: %s\n", q);
135 } else if ((q = largopt(p, "post-to", argv[0], &error)) != NULL) {
136 send = MSG_POST, header = 0;
137 buf_appendf(msg, "Newsgroups: %s\n", q);
138 } else if ((q = largopt(p, "subject", argv[0], &error)) != NULL) {
139 buf_appendf(msg, "Subject: %s\n", q);
140 } else if ((q = largopt(p, "header", argv[0], &error)) != NULL) {
141 buf_appendf(msg, "%s\n", q);
142 } else if ((q = largopt(p, "chain", argv[0], &error)) != NULL) {
143 buf_appendf(msg, "Chain: %s\n", q);
144 }
145 #ifdef USE_PGP
146 else if ((q = largopt(p, "reply-chain", argv[0], &error)) != NULL) {
147 buf_appendf(msg, "Reply-Chain: %s\n", q);
148 } else if ((q = largopt(p, "latency", argv[0], &error)) != NULL) {
149 buf_appendf(msg, "Latency: %s\n", q);
150 } else if ((q = largopt(p, "attachment", argv[0], &error)) != NULL) {
151 buf_appendf(attachments, "%s\n", q);
152 } else if ((q = largopt(p, "nym-config", argv[0], &error)) != NULL) {
153 deflt = 0;
154 strncpy(nym, q, sizeof(nym));
155 if (i > argc && strileft(argv[i + 1], "name="))
156 buf_sets(pseudonym, argv[++i] + 5);
157 else if (i > argc && strileft(argv[i + 1], "opt="))
158 buf_appends(nymopt, argv[++i] + 5);
159 } else if ((q = largopt(p, "nym", argv[0], &error)) != NULL) {
160 buf_appendf(msg, "Nym: %s\n", q);
161 }
162 #endif /* USE_PGP */
163 else if ((q = largopt(p, "copies", argv[0], &error)) != NULL) {
164 sscanf(q, "%d", &numcopies);
165 } else if ((q = largopt(p, "config", argv[0], &error)) != NULL) {
166 strncpy(MIXCONF, q, PATHMAX);
167 MIXCONF[PATHMAX-1] = 0;
168 mix_config(); /* configuration file changed - reread it */
169 } else if (error == 0 && mix_configline(p) == 0) {
170 fprintf(stderr, "%s: Invalid option %s\n", argv[0], argv[i]);
171 error = 1;
172 }
173 } else {
174 while (*++p) {
175 switch (*p) {
176 case 'd':
177 send = MSG_NULL, deflt = 0;
178 break;
179 case 'R':
180 readmail = 1, deflt = 0;
181 break;
182 case 'I':
183 readmail = 2, deflt = 0;
184 break;
185 case 'S':
186 sendpool = 1, deflt = 0;
187 break;
188 case 'M':
189 maint = 1, deflt = 0;
190 break;
191 #ifdef USE_SOCK
192 case 'P':
193 pop3 = 1, deflt = 0;
194 break;
195 #endif /* USE_SOCK */
196 case 'D':
197 daemon = 1, deflt = 0;
198 break;
199 case 'G':
200 keygen = 2, deflt = 0;
201 break;
202 case 'K':
203 keygen = 1, deflt = 0;
204 break;
205 case 'L': /* backwards compatibility */
206 break;
207 case 'v':
208 verbose = 1;
209 break;
210 case 'h':
211 help = 1, deflt = 0;
212 break;
213 case 'T':
214 type_list = 1;
215 break;
216 case 't':
217 if (*(p + 1) == 'o')
218 p++;
219 header = 0;
220 if (i < argc - 1)
221 buf_appendf(msg, "To: %s\n", argv[++i]);
222 else {
223 fprintf(stderr, "%s: Missing argument for option -to\n",
224 argv[0]);
225 error = 1;
226 }
227 break;
228 case 's':
229 if (i < argc - 1)
230 buf_appendf(msg, "Subject: %s\n", argv[++i]);
231 else {
232 noarg(argv[0], *p);
233 error = 1;
234 }
235 break;
236 case 'l':
237 if (i < argc - 1)
238 buf_appendf(msg, "Chain: %s\n", argv[++i]);
239 else {
240 noarg(argv[0], *p);
241 error = 1;
242 }
243 break;
244 case 'r':
245 if (i < argc - 1)
246 buf_appendf(msg, "Reply-Chain: %s\n", argv[++i]);
247 else {
248 noarg(argv[0], *p);
249 error = 1;
250 }
251 break;
252 #ifdef USE_PGP
253 case 'n':
254 if (i < argc - 1)
255 buf_appendf(msg, "Nym: %s\n", argv[++i]);
256 else {
257 noarg(argv[0], *p);
258 error = 1;
259 }
260 break;
261 #endif /* USE_PGP */
262 case 'c':
263 if (i < argc - 1)
264 sscanf(argv[++i], "%d", &numcopies);
265 else {
266 noarg(argv[0], *p);
267 error = 1;
268 }
269 break;
270 case 'p':
271 send = MSG_POST;
272 break;
273 case 'g':
274 if (i < argc - 1) {
275 send = MSG_POST, header = 0;
276 buf_appendf(msg, "Newsgroups: %s\n", argv[++i]);
277 } else {
278 noarg(argv[0], *p);
279 error = 1;
280 }
281 break;
282 case 'a':
283 if (i < argc - 1)
284 buf_appendf(attachments, "%s\n", argv[++i]);
285 else {
286 noarg(argv[0], *p);
287 error = 1;
288 }
289 break;
290 case 'm':
291 send = MSG_MAIL;
292 break;
293 default:
294 fprintf(stderr, "%s: Invalid option -%c\n", argv[0], *p);
295 error = 1;
296 break;
297 }
298 }
299 }
300 } else {
301 if (strchr(argv[i], '@')) {
302 header = 0;
303 buf_appendf(msg, "To: %s\n", argv[i]);
304 } else {
305 if (filename == NULL)
306 filename = argv[i];
307 else {
308 fprintf(stderr, "%s: Error in command line: %s\n", argv[0], argv[i]);
309 error = 1;
310 }
311 }
312 }
313 }
314
315 if (error) {
316 ret = 1;
317 goto end;
318 }
319 if (type_list) {
320 BUFFER *type2list;
321 type2list = buf_new();
322 if (prepare_type2list(type2list) < 0) {
323 fprintf(stderr, "Cannot print type2.list.\n");
324 ret = 2;
325 } else {
326 printf("%s", type2list->data);
327 };
328 buf_free(type2list);
329 goto end;
330 }
331 if (help || (isatty(fileno(stdin)) && isatty(fileno(stdout))))
332 fprintf(stderr, "Mixmaster %s - %s\n", VERSION, COPYRIGHT);
333
334 if (help) {
335 printf("Usage: %s [options] [user@host] [filename]\n\n", argv[0]);
336 printf("Options:\n\
337 \n\
338 -h, --help summary of command line options\n\
339 -T, --type-list list available remailers\n\
340 -t, --to=user@host the recipient's address(es)\n\
341 -g, --post-to=newsgroup newsgroup(s) to post to\n\
342 -p, --post input is a Usenet article\n\
343 -m, --mail input is a mail message\n\
344 -s, --subject=subject message subject\n\
345 --header='header line' arbitrary message headers\n\
346 -a, --attachment=file attach a file\n"
347 #ifdef USE_PGP
348 "-n, --nym=yournym use pseudonym to send the message\n\
349 --encrypt encrypt the message using the PGP format\n\
350 --sign sign the message using the PGP format\n"
351 #endif /* USE_PGP */
352 "-l, --chain=mix1,mix2,mix3,... specify a remailer chain\n\
353 -c, --copies=num send num copies to increase reliability\n\
354 -d, --dummy generate a dummy message\n\
355 -S, --send send the message(s) in the pool\n"
356 #ifdef USE_PGP
357 " --nym-config=yournym generate a new pseudonym\n\
358 --latency=hours reply chain latency\n\
359 --reply-chain=rem1,rem2,... reply chain for the pseudonym\n"
360 #endif /* USE_PGP */
361 "-v, --verbose output informational messages\n\
362 -f [file] read a mail folder\n"
363 #ifndef USE_NCURSES
364 "\n-fr, -ff, -fg [file] send reply/followup/group reply to a message\n"
365 #endif /* USE_NCURSES */
366 "\nThe input file is expected to contain mail headers if no address is\n\
367 specified in the command line.\n\
368 \n\
369 Remailer:\n\
370 \n\
371 -R, --read-mail read remailer message from stdin\n\
372 -I, --store-mail read remailer msg from stdin, do not decrypt\n\
373 -M, --remailer process the remailer pool\n\
374 -D, --daemon remailer as background process\n\
375 --no-detach do not detach from terminal as daemon\n"
376 #ifdef USE_SOCK
377 "-S, --send force sending messages from the pool\n"
378 #endif /* USE_SOCK */
379 "-P, --pop-mail force getting messages from POP3 servers\n\
380 -G, --generate-key generate a new remailer key\n\
381 -K, --update-keys generate remailer keys if necessary\n\
382 --config=file use alternate configuration file\n"
383 #ifdef WIN32SERVICE
384 "\n\
385 WinNT service:\n\
386 \n\
387 --install-svc install the service\n\
388 --remove-svc remove the service\n\
389 --run-svc run as a service\n"
390 #endif /* WIN32SERVICE */
391 );
392
393 ret = 0;
394 goto end;
395 }
396 if (deflt && send == -1)
397 send = MSG_MAIL;
398 if (nym[0] != 0)
399 send = -1;
400 if ((send == MSG_MAIL || send == MSG_POST) && filename == NULL &&
401 header == 1 && isatty(fileno(stdin))) {
402 /* we don't get here if USE_NCURSES is set */
403 printf("Run `%s -h' to view a summary of the command line options.\n\nEnter the message, complete with headers.\n",
404 argv[0]);
405 #ifdef UNIX
406 printf("When done, press ^D.\n\n");
407 #else
408 printf("When done, press ^Z.\n\n");
409 #endif /* else not UNIX */
410 }
411 if (header == 0)
412 buf_nl(msg);
413
414 if (readmail || redirect_mail || send == MSG_MAIL || send == MSG_POST) {
415 if (filename == NULL || streq(filename, "-"))
416 f = stdin;
417 else {
418 f = fopen(filename, "r");
419 if (f == NULL)
420 fprintf(stderr, "Can't open %s.\n", filename);
421 }
422
423 if (f && buf_read(msg, f) != -1) {
424 if (readmail == 1) {
425 check_get_pass(1);
426 mix_decrypt(msg);
427 } else if (readmail == 2)
428 pool_add(msg, "inf");
429 if (send == MSG_MAIL || send == MSG_POST || redirect_mail) {
430 BUFFER *sendmsg;
431 int numdest = 0;
432
433 sendmsg = buf_new();
434
435 while (buf_getheader(msg, field, content) == 0) {
436 if (bufieq(field, "nym")) {
437 strncpy(nym, content->data, sizeof(nym));
438 } else if (bufieq(field, "chain"))
439 if (strchr(content->data, ';')) {
440 i = strchr(content->data, ';') - (char *)content->data;
441 strncpy(chain, content->data, i);
442 if (strstr(content->data + i, "copies=") != NULL) {
443 sscanf(strstr(content->data + i, "copies=") +
444 sizeof("copies=") - 1, "%d", &numcopies);
445 }
446 } else
447 strncpy(chain, content->data, sizeof(chain));
448 else { /* line goes into message */
449 if (((redirect_mail || send == MSG_MAIL) && bufieq(field, "to"))
450 || (send == MSG_POST && bufieq(field, "newsgroups")))
451 numdest++;
452 if (bufieq(field, "from") && !redirect_mail)
453 fprintf(stderr, "Warning: The message has a From: line.\n");
454 buf_appendheader(sendmsg, field, content);
455 }
456 }
457 buf_nl(sendmsg);
458 buf_rest(sendmsg, msg);
459
460 while (buf_getline(attachments, field) != -1)
461 if (attachfile(sendmsg, field) == -1) {
462 errlog(ERRORMSG, "Can't attach %b!\n", field);
463 ret = 2;
464 goto end;
465 }
466
467 #ifdef USE_PGP
468 if (nym[0] != 0 && strchr(nym, '@') == NULL)
469 strcatn(nym, "@", sizeof(nym));
470 if (sign || encrypt) {
471 BUFFER *pass;
472
473 pass = buf_new();
474 user_pass(pass);
475 if (pgp_mailenc((encrypt ? PGP_ENCRYPT : 0) |
476 (nym[0] != 0 && sign ? PGP_SIGN : 0) |
477 PGP_TEXT | PGP_REMAIL, sendmsg, nym,
478 pass, NULL, NYMSECRING) != 0) {
479 fprintf(stderr, "Encryption failed: missing key!");
480 ret = 2;
481 goto end;
482 }
483 buf_free(pass);
484 }
485 if (nym[0] != 0) {
486 if (nym_encrypt(sendmsg, nym, send) == 0)
487 send = MSG_MAIL;
488 else
489 fprintf(stderr, "Nym error, sending message anonymously.\n");
490 }
491 #endif /* USE_PGP */
492 if (numdest == 0) {
493 fprintf(stderr, "No destination address given!\n");
494 ret = 2;
495 } else if (numcopies < 0 || numcopies > 10) {
496 fprintf(stderr, "Invalid number of copies!\n");
497 ret = 2;
498 } else {
499 if ( ( redirect_mail ?
500 redirect_message(sendmsg, chain, numcopies, chainlist) :
501 mix_encrypt(send, sendmsg, chain, numcopies, chainlist)
502 ) == -1) {
503 ret = 2;
504 if (chainlist->length)
505 fprintf(stderr, "%s\n", chainlist->data);
506 else
507 fprintf(stderr, "Failed!\n");
508 } else if (verbose) {
509 fprintf(stderr, "Chain: ");
510 buf_write(chainlist, stderr);
511 }
512 }
513
514 buf_free(sendmsg);
515 }
516 if (filename != NULL)
517 fclose(f);
518 } else
519 ret = 2;
520 }
521 if (send == MSG_NULL) {
522 if (msg->length) {
523 while (buf_getheader(msg, field, content) == 0) {
524 if (bufieq(field, "chain"))
525 strncpy(chain, content->data, sizeof(chain));
526 }
527 }
528 if (mix_encrypt(MSG_NULL, NULL, chain, numcopies, chainlist) == -1) {
529 ret = 2;
530 if (chainlist->length)
531 fprintf(stderr, "%s\n", chainlist->data);
532 else
533 fprintf(stderr, "Failed!\n");
534 } else if (verbose) {
535 fprintf(stderr, "Chain: ");
536 buf_write(chainlist, stderr);
537 }
538 }
539 #ifdef USE_PGP
540 if (nym[0] != 0) {
541 char nymserver[LINELEN] = "*";
542 BUFFER *chains;
543
544 chains = buf_new();
545 if (numcopies < 1 || numcopies > 10)
546 numcopies = 1;
547 while (buf_getheader(msg, field, content) != -1) {
548 if (bufieq(field, "chain"))
549 strncpy(chain, content->data, sizeof(chain));
550 else if (bufieq(field, "reply-chain"))
551 buf_appendf(chains, "Chain: %b\n", content);
552 else if (field->length)
553 buf_appendheader(chains, field, content);
554 else
555 buf_nl(chains);
556 }
557 if (strrchr(nym, '@')) {
558 strncpy(nymserver, strrchr(nym, '@'), sizeof(nymserver));
559 *strrchr(nym, '@') = '\0';
560 }
561 if (nym_config(NYM_CREATE, nym, nymserver, pseudonym,
562 chain, numcopies, chains, nymopt) < 0) {
563 ret = 2;
564 fprintf(stderr, "Failed!\n");
565 }
566 user_delpass();
567 buf_free(chains);
568 }
569 #endif /* USE_PGP */
570
571 if (keygen) {
572 check_get_pass(0);
573 keymgt(keygen);
574 }
575 if (sendpool)
576 mix_send();
577 #ifdef USE_SOCK
578 if (pop3)
579 pop3get();
580 #endif /* USE_SOCK */
581 if (maint) {
582 check_get_pass(1);
583 mix_regular(0);
584 }
585
586 clientpool:
587 if ((REMAIL == 0) && (CLIENTAUTOFLUSH == 1)) {
588 SENDPOOLTIME = 0;
589 RATE = 100;
590 mix_send();
591 };
592
593 end:
594 buf_free(field);
595 buf_free(content);
596 buf_free(chainlist);
597 buf_free(msg);
598 buf_free(nymopt);
599 buf_free(pseudonym);
600 buf_free(attachments);
601
602 if (daemon) {
603 check_get_pass(1);
604 #ifdef UNIX
605 if (! nodetach) {
606 int pid;
607
608 fprintf(stderr, "Detaching.\n");
609 /* Detach as suggested by the Unix Programming FAQ */
610 pid = fork();
611 if (pid > 0)
612 exit(0);
613 if (setsid() < 0) {
614 /* This should never happen. */
615 fprintf(stderr, "setsid() failed.\n");
616 exit(1);
617 };
618 pid = fork();
619 if (pid > 0)
620 exit(0);
621 };
622 if (chdir(MIXDIR) < 0) {
623 if (chdir("/") < 0) {
624 fprintf(stderr, "Cannot chdir to mixdir or /.\n");
625 exit(1);
626 };
627 };
628 if (write_pidfile(PIDFILE)) {
629 fprintf(stderr, "Aborting.\n");
630 exit(1);
631 }
632 if (! nodetach) {
633 freopen ("/dev/null", "r", stdin);
634 freopen ("/dev/null", "w", stdout);
635 freopen ("/dev/null", "w", stderr);
636 }
637 #endif /* UNIX */
638 mix_daemon();
639 #ifdef UNIX
640 /* ifdef this one to, so that we do not need to export it from windows dll */
641 clear_pidfile(PIDFILE);
642 #endif /* UNIX */
643 }
644 mix_exit();
645 return (ret);
646 }
647
648 static char *largopt(char *p, char *opt, char *name, int *error)
649 {
650 if (streq(p, opt)) {
651 fprintf(stderr, "%s: Missing argument for option --%s\n", name, p);
652 *error = 1;
653 } else if (strleft(p, opt) && p[strlen(opt)] == '=') {
654 return (p + strlen(opt) + 1);
655 }
656 return (NULL);
657 }
658
659 static void noarg(char *name, char p)
660 {
661 fprintf(stderr, "%s: Missing argument for option -%c\n", name, p);
662 }
663
664 static int check_get_pass(int force)
665 /* get a passphrase and check against keys
666 * if force != 0 passphrase must match with some key */
667 {
668 BUFFER *pass, *pass2, *key;
669 int n = 0;
670
671 if (PASSPHRASE[0] == '\0' && isatty(fileno(stdin))) {
672 pass = buf_new();
673 pass2 = buf_new();
674 key = buf_new();
675 buf_sets(pass, PASSPHRASE);
676 while (pgpdb_getkey(PK_DECRYPT, PGP_ES_RSA, NULL, NULL, NULL, NULL, NULL,
677 NULL, NULL, NULL, pass) < 0 &&
678 pgpdb_getkey(PK_DECRYPT, PGP_E_ELG, NULL, NULL, NULL, NULL, NULL,
679 NULL, NULL, NULL, pass) < 0 &&
680 getv2seckey(NULL, key) < 0)
681 {
682 user_delpass();
683 if (n)
684 fprintf(stderr, "re-");
685 user_pass(pass);
686 strncpy(PASSPHRASE, pass->data, LINELEN);
687 PASSPHRASE[LINELEN-1] = 0;
688 if (!force) {
689 if (n && buf_eq(pass, pass2))
690 break;
691 buf_set(pass2, pass);
692 }
693 n=1;
694 }
695 user_delpass();
696 buf_free(pass);
697 buf_free(pass2);
698 buf_free(key);
699
700 strncpy(ENTEREDPASSPHRASE, PASSPHRASE, LINELEN);
701 ENTEREDPASSPHRASE[LINELEN-1] = 0;
702 }
703 return 1;
704 }

  ViewVC Help
Powered by ViewVC 1.1.5