Annotation of researchv10no/cmd/sign/enroll.c, revision 1.1.1.1

1.1       root        1: #include <stdio.h>
                      2: #include <string.h>
                      3: 
                      4: 
                      5: extern char *getpass();
                      6: extern char *getlogin();
                      7: extern void exit();
                      8: char name[10];
                      9: 
                     10: main()
                     11: {
                     12:        strcpy(name,getlogin());
                     13:        return enrollfn();
                     14: }
                     15: 
                     16: enrollfn()
                     17: {
                     18:        char *opw, *pw1, *pw2;
                     19: 
                     20:        opw = "";
                     21: 
                     22:        pw1 = getpass("Signature key:");
                     23:        if(pw1) pw1 = strdup(pw1);
                     24:        if(pw1) pw2 = strdup(getpass("Again:"));
                     25:        if(pw1==0 || pw2==0) {
                     26:                fprintf(stderr,"enroll: failed to get passwords\n");
                     27:                exit(1);
                     28:        }
                     29:        if(strcmp(pw1, pw2)!=0)exit(1);
                     30: 
                     31:        switch( enroll(name, opw, pw1) ) {
                     32:        case 0:
                     33:                printf("BAD enroll of %s\n", name);
                     34:                return 1;
                     35:                break;
                     36:        default:
                     37:                printf("Server uncommunicative; try again later\n");
                     38:                return 1;
                     39:                break;
                     40:        case 1:
                     41:                printf("GOOD enroll of %s\n", name);
                     42:                return 0;
                     43:                break;
                     44:        }
                     45: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.