diff options
author | Petter Rodhelind <petter.rodhelind@gmail.com> | 2020-01-14 11:41:08 +0100 |
---|---|---|
committer | Petter Rodhelind <petter.rodhelind@gmail.com> | 2020-01-14 11:41:08 +0100 |
commit | 02d7aa8915f9c3a3288dab01f321eb94ba219e3b (patch) | |
tree | f053238978479e408a2b83571443e132f30586ab /src/cmd/auth/factotum | |
parent | c0c9d8f883dfd3a7f5a74499d91bb95884b15873 (diff) | |
parent | 3d1382b98a502d0c34d5ba2c462396acc515016e (diff) | |
download | plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.gz plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.bz2 plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/cmd/auth/factotum')
-rw-r--r-- | src/cmd/auth/factotum/apop.c | 7 | ||||
-rw-r--r-- | src/cmd/auth/factotum/attr.c | 4 | ||||
-rw-r--r-- | src/cmd/auth/factotum/chap.c | 10 | ||||
-rw-r--r-- | src/cmd/auth/factotum/conv.c | 1 | ||||
-rw-r--r-- | src/cmd/auth/factotum/cpu.c | 8 | ||||
-rw-r--r-- | src/cmd/auth/factotum/dat.h | 2 | ||||
-rw-r--r-- | src/cmd/auth/factotum/dsa.c | 23 | ||||
-rw-r--r-- | src/cmd/auth/factotum/fs.c | 9 | ||||
-rw-r--r-- | src/cmd/auth/factotum/httpdigest.c | 10 | ||||
-rw-r--r-- | src/cmd/auth/factotum/key.c | 4 | ||||
-rw-r--r-- | src/cmd/auth/factotum/log.c | 1 | ||||
-rw-r--r-- | src/cmd/auth/factotum/main.c | 2 | ||||
-rw-r--r-- | src/cmd/auth/factotum/p9any.c | 9 | ||||
-rw-r--r-- | src/cmd/auth/factotum/p9cr.c | 8 | ||||
-rw-r--r-- | src/cmd/auth/factotum/p9sk1.c | 7 | ||||
-rw-r--r-- | src/cmd/auth/factotum/pass.c | 4 | ||||
-rw-r--r-- | src/cmd/auth/factotum/pkcs1.c | 15 | ||||
-rw-r--r-- | src/cmd/auth/factotum/rpc.c | 5 | ||||
-rw-r--r-- | src/cmd/auth/factotum/rsa.c | 40 | ||||
-rw-r--r-- | src/cmd/auth/factotum/secstore.c | 1 | ||||
-rw-r--r-- | src/cmd/auth/factotum/std.h | 1 | ||||
-rw-r--r-- | src/cmd/auth/factotum/util.c | 2 | ||||
-rw-r--r-- | src/cmd/auth/factotum/wep.c | 6 | ||||
-rw-r--r-- | src/cmd/auth/factotum/xio.c | 3 |
24 files changed, 84 insertions, 98 deletions
diff --git a/src/cmd/auth/factotum/apop.c b/src/cmd/auth/factotum/apop.c index 992cc0ad..d3d8c95a 100644 --- a/src/cmd/auth/factotum/apop.c +++ b/src/cmd/auth/factotum/apop.c @@ -10,7 +10,7 @@ * S -> C: ok * * Note that this is the protocol between factotum and the local - * program, not between the two factotums. The information + * program, not between the two factotums. The information * exchanged here is wrapped in the APOP protocol by the local * programs. * @@ -42,7 +42,7 @@ apopclient(Conv *c) Attr *attr; DigestState *ds; Key *k; - + chal = nil; k = nil; res = nil; @@ -328,7 +328,7 @@ apopresp(ServerState *s, char *user, char *resp) } static Role -apoproles[] = +apoproles[] = { "client", apopclient, "server", apopserver, @@ -350,4 +350,3 @@ Proto cram = { apopcheck, nil }; - diff --git a/src/cmd/auth/factotum/attr.c b/src/cmd/auth/factotum/attr.c index 1c037a53..25a46159 100644 --- a/src/cmd/auth/factotum/attr.c +++ b/src/cmd/auth/factotum/attr.c @@ -53,7 +53,7 @@ addattrs(Attr *a, Attr *b) break; } } - return a; + return a; } void @@ -201,7 +201,7 @@ matchattr(Attr *pat, Attr *a0, Attr *a1) break; } } - return 1; + return 1; } Attr* diff --git a/src/cmd/auth/factotum/chap.c b/src/cmd/auth/factotum/chap.c index fa44db96..d4fee3c4 100644 --- a/src/cmd/auth/factotum/chap.c +++ b/src/cmd/auth/factotum/chap.c @@ -1,6 +1,6 @@ /* * CHAP, MSCHAP - * + * * The client does not authenticate the server, hence no CAI * * Protocol: @@ -51,7 +51,7 @@ nthash(uchar hash[MShashlen], char *passwd) { uchar buf[512]; int i; - + for(i=0; *passwd && i<sizeof(buf); passwd++) { buf[i++] = *passwd; buf[i++] = 0; @@ -96,7 +96,7 @@ mschalresp(uchar resp[MSresplen], uchar hash[MShashlen], uchar chal[MSchallen]) { int i; uchar buf[21]; - + memset(buf, 0, sizeof(buf)); memcpy(buf, hash, MShashlen); @@ -404,7 +404,7 @@ chapresp(ServerState *s, char *user, char *resp) } static Role -chaproles[] = +chaproles[] = { "client", chapclient, "server", chapserver, @@ -424,5 +424,3 @@ Proto mschap = { "user? !password?", chapcheck }; - - diff --git a/src/cmd/auth/factotum/conv.c b/src/cmd/auth/factotum/conv.c index 3a8cf590..090a5ad3 100644 --- a/src/cmd/auth/factotum/conv.c +++ b/src/cmd/auth/factotum/conv.c @@ -268,4 +268,3 @@ convbadkey(Conv *c, Key *k, char *msg, Attr *a) return -1; return 0; } - diff --git a/src/cmd/auth/factotum/cpu.c b/src/cmd/auth/factotum/cpu.c index 46399049..64c4c980 100644 --- a/src/cmd/auth/factotum/cpu.c +++ b/src/cmd/auth/factotum/cpu.c @@ -168,7 +168,7 @@ main(int argc, char **argv) /* start up a process to pass along notes */ lclnoteproc(data); - /* + /* * Wait for the other end to execute and start our file service * of /mnt/term */ @@ -246,7 +246,7 @@ old9p(int fd) close(fd); close(p[0]); } - return p[1]; + return p[1]; } /* Invoked with stdin, stdout and stderr connected to the network connection */ @@ -392,7 +392,7 @@ readstr(int fd, char *str, int len) while(len) { n = read(fd, str, 1); - if(n < 0) + if(n < 0) return -1; if(*str == '\0') return 0; @@ -659,7 +659,7 @@ rmtnoteproc(void) syslog(0, "cpu", "cpu -R: can't open %s", rmtnotefile); _exits(0); } - + for(;;){ n = read(fd, buf, sizeof(buf)-1); if(n <= 0){ diff --git a/src/cmd/auth/factotum/dat.h b/src/cmd/auth/factotum/dat.h index 49377f40..db4a3b1e 100644 --- a/src/cmd/auth/factotum/dat.h +++ b/src/cmd/auth/factotum/dat.h @@ -57,7 +57,7 @@ struct Conv Req *req; /* 9P call to read response */ Channel *keywait; /* wait here for key confirmation */ - + }; struct Key diff --git a/src/cmd/auth/factotum/dsa.c b/src/cmd/auth/factotum/dsa.c index ced10355..aa67881e 100644 --- a/src/cmd/auth/factotum/dsa.c +++ b/src/cmd/auth/factotum/dsa.c @@ -3,7 +3,7 @@ /* * DSA signing and verification - * + * * Sign: * start p=xxx q=xxx alpha=xxx key=xxx * write msg @@ -14,10 +14,10 @@ * write msg * write signature(msg) * read ok or fail - * + * * all numbers are hexadecimal bigints parsable with strtomp. */ - + static int xdsasign(Conv *c) { @@ -58,7 +58,7 @@ xdsasign(Conv *c) } /* - * convert to canonical form (lower case) + * convert to canonical form (lower case) * for use in attribute matches. */ static void @@ -78,11 +78,11 @@ readdsapriv(Key *k) priv = dsaprivalloc(); - if((a=strfindattr(k->attr, "p"))==nil + if((a=strfindattr(k->attr, "p"))==nil || (priv->pub.p=strtomp(a, nil, 16, nil))==nil) goto Error; strlwr(a); - if((a=strfindattr(k->attr, "q"))==nil + if((a=strfindattr(k->attr, "q"))==nil || (priv->pub.q=strtomp(a, nil, 16, nil))==nil) goto Error; strlwr(a); @@ -90,15 +90,15 @@ readdsapriv(Key *k) werrstr("dsa: p or q not prime"); goto Error; } - if((a=strfindattr(k->attr, "alpha"))==nil + if((a=strfindattr(k->attr, "alpha"))==nil || (priv->pub.alpha=strtomp(a, nil, 16, nil))==nil) goto Error; strlwr(a); - if((a=strfindattr(k->attr, "key"))==nil + if((a=strfindattr(k->attr, "key"))==nil || (priv->pub.key=strtomp(a, nil, 16, nil))==nil) goto Error; strlwr(a); - if((a=strfindattr(k->privattr, "!secret"))==nil + if((a=strfindattr(k->privattr, "!secret"))==nil || (priv->secret=strtomp(a, nil, 16, nil))==nil) goto Error; strlwr(a); @@ -113,7 +113,7 @@ static int dsacheck(Key *k) { static int first = 1; - + if(first){ fmtinstall('B', mpfmt); first = 0; @@ -134,7 +134,7 @@ dsaclose(Key *k) } static Role -dsaroles[] = +dsaroles[] = { "sign", xdsasign, 0 @@ -147,4 +147,3 @@ Proto dsa = { dsacheck, dsaclose }; - diff --git a/src/cmd/auth/factotum/fs.c b/src/cmd/auth/factotum/fs.c index fd89b2c2..811bd5b0 100644 --- a/src/cmd/auth/factotum/fs.c +++ b/src/cmd/auth/factotum/fs.c @@ -65,7 +65,7 @@ rootdirgen(int n, Dir *dir, void *v) if(n > 0) return -1; - + fillstat(dir, factname, QTDIR, Qfactotum, DMDIR|0555); return 0; } @@ -224,7 +224,7 @@ convlist(int i, char *a, uint nn) memmove(a, buf, n); return n; } - + static void fskickreply(Conv *c) { @@ -250,7 +250,7 @@ fskickreply(Conv *c) respond(r, nil); c->nreply = 0; } - + /* * Some of the file system work happens in the fs proc, but * fsopen, fsread, fswrite, fsdestroyfid, and fsflush happen in @@ -305,7 +305,7 @@ fsopen(Req *r) c->kickreply = fskickreply; r->fid->aux = c; } - + respond(r, nil); } @@ -538,4 +538,3 @@ fsinit0(void) fs.destroyfid = fssendclunk; fs.start = fsstart; } - diff --git a/src/cmd/auth/factotum/httpdigest.c b/src/cmd/auth/factotum/httpdigest.c index 3e299bf5..1e9d5793 100644 --- a/src/cmd/auth/factotum/httpdigest.c +++ b/src/cmd/auth/factotum/httpdigest.c @@ -2,7 +2,7 @@ * HTTPDIGEST - MD5 challenge/response authentication (RFC 2617) * * Client protocol: - * write challenge: nonce method uri + * write challenge: nonce method uri * read response: 2*MD5dlen hex digits * * Server protocol: @@ -22,10 +22,10 @@ hdclient(Conv *c) char *realm, *passwd, *user, *f[4], *s, resp[MD5dlen*2+1]; int ret; Key *k; - + ret = -1; s = nil; - + c->state = "keylookup"; k = keyfetch(c, "%A", c->attr); if(k == nil) @@ -45,7 +45,7 @@ hdclient(Conv *c) digest(user, realm, passwd, f[0], f[1], f[2], resp); convwrite(c, resp, strlen(resp)); ret = 0; - + out: free(s); keyclose(k); @@ -103,7 +103,7 @@ digest(char *user, char *realm, char *passwd, strtolower(dig); } -static Role hdroles[] = +static Role hdroles[] = { "client", hdclient, 0 diff --git a/src/cmd/auth/factotum/key.c b/src/cmd/auth/factotum/key.c index 9df50eb3..817df97b 100644 --- a/src/cmd/auth/factotum/key.c +++ b/src/cmd/auth/factotum/key.c @@ -161,7 +161,7 @@ keyreplace(Conv *c, Key *k, char *fmt, ...) sysfatal("out of memory"); va_end(arg); - /* replace prompted values with prompts */ + /* replace prompted values with prompts */ a = copyattr(k->attr); bp = parseattr(k->proto->keyprompt); for(b=bp; b; b=b->next){ @@ -204,7 +204,7 @@ keyevict(Conv *c, Key *k, char *fmt, ...) sysfatal("out of memory"); va_end(arg); - /* replace prompted values with prompts */ + /* replace prompted values with prompts */ a = copyattr(k->attr); bp = parseattr(k->proto->keyprompt); for(b=bp; b; b=b->next){ diff --git a/src/cmd/auth/factotum/log.c b/src/cmd/auth/factotum/log.c index 4d29536b..e644028a 100644 --- a/src/cmd/auth/factotum/log.c +++ b/src/cmd/auth/factotum/log.c @@ -118,4 +118,3 @@ flog(char *fmt, ...) lbvappend(&logbuf, fmt, arg); va_end(arg); } - diff --git a/src/cmd/auth/factotum/main.c b/src/cmd/auth/factotum/main.c index 1f603ac7..b3ace12c 100644 --- a/src/cmd/auth/factotum/main.c +++ b/src/cmd/auth/factotum/main.c @@ -142,7 +142,7 @@ sendkey(Attr *attr) int rv; char buf[8192]; CFid *fid; - + fid = nsopen("factotum", nil, "ctl", OWRITE); if(fid == nil) sysfatal("opening factotum/ctl: %r"); diff --git a/src/cmd/auth/factotum/p9any.c b/src/cmd/auth/factotum/p9any.c index 0267a616..079eed94 100644 --- a/src/cmd/auth/factotum/p9any.c +++ b/src/cmd/auth/factotum/p9any.c @@ -9,7 +9,7 @@ * C->S: proto dom NUL * [negotiated proto continues] */ - + extern Proto p9sk1, p9sk2, p9cr; static Proto* okproto[] = @@ -111,7 +111,7 @@ p9anyserver(Conv *c) } ret = 0; - + out: free(s); freeattr(attr); @@ -222,7 +222,7 @@ found: /* f[i] is the chosen protocol, q the chosen domain */ attr = addattr(attr, "proto=%q dom=%q", f[i], q); c->state = "write choice"; - + /* have a key: go for it */ choice = estrappend(nil, "%q %q", f[i], q); if(convwrite(c, choice, strlen(choice)+1) < 0){ @@ -258,7 +258,7 @@ out: } static Role -p9anyroles[] = +p9anyroles[] = { "client", p9anyclient, "server", p9anyserver, @@ -269,4 +269,3 @@ Proto p9any = { "p9any", p9anyroles }; - diff --git a/src/cmd/auth/factotum/p9cr.c b/src/cmd/auth/factotum/p9cr.c index 1c3f21e1..84860d16 100644 --- a/src/cmd/auth/factotum/p9cr.c +++ b/src/cmd/auth/factotum/p9cr.c @@ -9,7 +9,7 @@ * S -> C: ok or bad * * Note that this is the protocol between factotum and the local - * program, not between the two factotums. The information + * program, not between the two factotums. The information * exchanged here is wrapped in other protocols by the local * programs. */ @@ -290,6 +290,8 @@ p9crresp(ServerState *s, uchar *resp, int resplen) Ticket t; Ticketreq tr; + memset(&tr, 0, sizeof tr); // TODO: what should tr be initialized to? + if(xiowrite(s->asfd, resp, resplen) != resplen) return -1; @@ -317,7 +319,7 @@ p9crresp(ServerState *s, uchar *resp, int resplen) static int p9response(char *pw, uchar *chal, uchar *resp) -{ +{ char key[DESKEYLEN]; uchar buf[8]; ulong x; @@ -338,7 +340,7 @@ static int vncresponse(char *pw, uchar *chal, uchar *resp) { DESstate des; - + memmove(resp, chal, MAXCHAL); setupDESstate(&des, 0, nil); // XXX put key in for 0 desECBencrypt(resp, MAXCHAL, &des); diff --git a/src/cmd/auth/factotum/p9sk1.c b/src/cmd/auth/factotum/p9sk1.c index 0a79a361..d2d7eb89 100644 --- a/src/cmd/auth/factotum/p9sk1.c +++ b/src/cmd/auth/factotum/p9sk1.c @@ -93,7 +93,7 @@ p9skclient(Conv *c) k = keyfetch(c, "%A", a); if(k == nil) goto out; - + /* relay ticket request to auth server, get tickets */ strcpy(tr.hostid, strfindattr(k->attr, "user")); if(speakfor) @@ -329,7 +329,7 @@ p9sk1close(Key *k) } static Role -p9sk1roles[] = +p9sk1roles[] = { "client", p9skclient, "server", p9skserver, @@ -337,7 +337,7 @@ p9sk1roles[] = }; static Role -p9sk2roles[] = +p9sk2roles[] = { "client", p9skclient, "server", p9skserver, @@ -356,4 +356,3 @@ Proto p9sk2 = { "p9sk2", p9sk2roles }; - diff --git a/src/cmd/auth/factotum/pass.c b/src/cmd/auth/factotum/pass.c index 453045ce..ddda9596 100644 --- a/src/cmd/auth/factotum/pass.c +++ b/src/cmd/auth/factotum/pass.c @@ -15,12 +15,12 @@ static int passproto(Conv *c) { Key *k; - + k = keyfetch(c, "%A", c->attr); if(k == nil) return -1; c->state = "write"; - convprint(c, "%q %q", + convprint(c, "%q %q", strfindattr(k->attr, "user"), strfindattr(k->privattr, "!password")); return 0; diff --git a/src/cmd/auth/factotum/pkcs1.c b/src/cmd/auth/factotum/pkcs1.c index f3278454..0e116f2d 100644 --- a/src/cmd/auth/factotum/pkcs1.c +++ b/src/cmd/auth/factotum/pkcs1.c @@ -12,7 +12,7 @@ * * We sign hashes of messages instead of the messages * themselves. - * + * * The hashes are encoded in ASN.1 DER to identify * the signature type, and then prefixed with 0x01 PAD 0x00 * where PAD is as many 0xFF bytes as desired. @@ -138,7 +138,7 @@ mptoberjust(mpint *b, uchar *buf, uint len) #define O3(x) \ (((x)>>14)&0x7F)|0x80, \ (((x)>>7)&0x7F)|0x80, \ - ((x)&0x7F) + ((x)&0x7F) uchar oidsha1[] = { O0(1, 3), 14, 3, 2, 26 }; uchar oidmd2[] = { O0(1, 2), O2(840), O3(113549), 2, 2 }; uchar oidmd5[] = { O0(1, 2), O2(840), O3(113549), 2, 5 }; @@ -174,11 +174,11 @@ mkasn1(uchar *asn1, DigestAlg *alg, uchar *d, uint dlen) sysfatal("bad alg in mkasn1"); return -1; } - + p = asn1; *p++ = 0x30; /* sequence */ p++; - + *p++ = 0x30; /* another sequence */ p++; @@ -186,12 +186,12 @@ mkasn1(uchar *asn1, DigestAlg *alg, uchar *d, uint dlen) *p++ = olen; memmove(p, obj, olen); p += olen; - + *p++ = 0x05; /* null */ *p++ = 0; - + asn1[3] = p - (asn1+4); /* end of inner sequence */ - + *p++ = 0x04; /* octet string */ *p++ = dlen; memmove(p, d, dlen); @@ -200,4 +200,3 @@ mkasn1(uchar *asn1, DigestAlg *alg, uchar *d, uint dlen) asn1[1] = p - (asn1+2); /* end of outer sequence */ return p-asn1; } - diff --git a/src/cmd/auth/factotum/rpc.c b/src/cmd/auth/factotum/rpc.c index ad894330..26d5fd4b 100644 --- a/src/cmd/auth/factotum/rpc.c +++ b/src/cmd/auth/factotum/rpc.c @@ -32,7 +32,7 @@ * done [haveai] - authentication is done [haveai: you can get an ai with authinfo] */ -char *rpcname[] = +char *rpcname[] = { "unknown", "authinfo", @@ -196,7 +196,7 @@ rpcexec(Conv *c) rpcrespond(c, "error conversation not successful"); else{ /* make up an auth info using the attr */ - p = convAI2M((uchar*)c->reply+3, sizeof c->reply-3, + p = convAI2M((uchar*)c->reply+3, sizeof c->reply-3, strfindattr(c->attr, "cuid"), strfindattr(c->attr, "suid"), strfindattr(c->attr, "cap"), @@ -341,4 +341,3 @@ convAI2M(uchar *p, int n, char *cuid, char *suid, char *cap, char *hex) werrstr("authinfo too big"); return p; } - diff --git a/src/cmd/auth/factotum/rsa.c b/src/cmd/auth/factotum/rsa.c index 95545f93..e59feaab 100644 --- a/src/cmd/auth/factotum/rsa.c +++ b/src/cmd/auth/factotum/rsa.c @@ -3,7 +3,7 @@ /* * RSA authentication. - * + * * Encrypt/Decrypt: * start n=xxx ek=xxx * write msg @@ -13,7 +13,7 @@ * start n=xxx ek=xxx * write hash(msg) * read signature(hash(msg)) - * + * * Verify: * start n=xxx ek=xxx * write hash(msg) @@ -44,14 +44,14 @@ xrsadecrypt(Conv *c) if(k == nil) goto out; key = k->priv; - + /* make sure have private half if needed */ role = strfindattr(c->attr, "role"); if(strcmp(role, "decrypt") == 0 && !key->c2){ werrstr("missing private half of key -- cannot decrypt"); goto out; } - + /* read text */ c->state = "read"; if((n=convreadm(c, &txt)) < 0) @@ -60,7 +60,7 @@ xrsadecrypt(Conv *c) convprint(c, "data too short"); goto out; } - + /* encrypt/decrypt */ m = betomp((uchar*)txt, n, nil); if(m == nil) @@ -72,7 +72,7 @@ xrsadecrypt(Conv *c) if(mm == nil) goto out; n = mptobe(mm, (uchar*)buf, sizeof buf, nil); - + /* send response */ c->state = "write"; convwrite(c, buf, n); @@ -98,7 +98,7 @@ xrsasign(Conv *c) char *sig2; ret = -1; - + /* fetch key */ c->state = "keylookup"; k = keylookup("%A", c->attr); @@ -112,7 +112,7 @@ xrsasign(Conv *c) werrstr("missing private half of key -- cannot sign"); goto out; } - + /* get hash type from key */ hash = strfindattr(k->attr, "hash"); if(hash == nil) @@ -144,7 +144,7 @@ xrsasign(Conv *c) /* read signature */ if((n = convreadm(c, &sig2)) < 0) goto out; - + /* verify */ if(rsaverify(&key->pub, hashfn, digest, dlen, (uchar*)sig2, n) == 0) convprint(c, "ok"); @@ -160,7 +160,7 @@ out: } /* - * convert to canonical form (lower case) + * convert to canonical form (lower case) * for use in attribute matches. */ static void @@ -180,22 +180,22 @@ readrsapriv(Key *k) priv = rsaprivalloc(); - if((a=strfindattr(k->attr, "ek"))==nil + if((a=strfindattr(k->attr, "ek"))==nil || (priv->pub.ek=strtomp(a, nil, 16, nil))==nil) goto Error; strlwr(a); - if((a=strfindattr(k->attr, "n"))==nil + if((a=strfindattr(k->attr, "n"))==nil || (priv->pub.n=strtomp(a, nil, 16, nil))==nil) goto Error; strlwr(a); if(k->privattr == nil) /* only public half */ return priv; - if((a=strfindattr(k->privattr, "!p"))==nil + if((a=strfindattr(k->privattr, "!p"))==nil || (priv->p=strtomp(a, nil, 16, nil))==nil) goto Error; strlwr(a); - if((a=strfindattr(k->privattr, "!q"))==nil + if((a=strfindattr(k->privattr, "!q"))==nil || (priv->q=strtomp(a, nil, 16, nil))==nil) goto Error; strlwr(a); @@ -203,19 +203,19 @@ readrsapriv(Key *k) werrstr("rsa: p or q not prime"); goto Error; } - if((a=strfindattr(k->privattr, "!kp"))==nil + if((a=strfindattr(k->privattr, "!kp"))==nil || (priv->kp=strtomp(a, nil, 16, nil))==nil) goto Error; strlwr(a); - if((a=strfindattr(k->privattr, "!kq"))==nil + if((a=strfindattr(k->privattr, "!kq"))==nil || (priv->kq=strtomp(a, nil, 16, nil))==nil) goto Error; strlwr(a); - if((a=strfindattr(k->privattr, "!c2"))==nil + if((a=strfindattr(k->privattr, "!c2"))==nil || (priv->c2=strtomp(a, nil, 16, nil))==nil) goto Error; strlwr(a); - if((a=strfindattr(k->privattr, "!dk"))==nil + if((a=strfindattr(k->privattr, "!dk"))==nil || (priv->dk=strtomp(a, nil, 16, nil))==nil) goto Error; strlwr(a); @@ -230,7 +230,7 @@ static int rsacheck(Key *k) { static int first = 1; - + if(first){ fmtinstall('B', mpfmt); first = 0; @@ -251,7 +251,7 @@ rsaclose(Key *k) } static Role -rsaroles[] = +rsaroles[] = { "sign", xrsasign, "verify", xrsasign, /* public operation */ diff --git a/src/cmd/auth/factotum/secstore.c b/src/cmd/auth/factotum/secstore.c index c17c3cf2..9928d361 100644 --- a/src/cmd/auth/factotum/secstore.c +++ b/src/cmd/auth/factotum/secstore.c @@ -659,4 +659,3 @@ Out: free(sta); return rv; } - diff --git a/src/cmd/auth/factotum/std.h b/src/cmd/auth/factotum/std.h index 814664e0..52c55b7c 100644 --- a/src/cmd/auth/factotum/std.h +++ b/src/cmd/auth/factotum/std.h @@ -7,4 +7,3 @@ #include <thread.h> #include <fcall.h> #include <9p.h> - diff --git a/src/cmd/auth/factotum/util.c b/src/cmd/auth/factotum/util.c index accddddd..dce37dca 100644 --- a/src/cmd/auth/factotum/util.c +++ b/src/cmd/auth/factotum/util.c @@ -50,5 +50,3 @@ estrappend(char *s, char *fmt, ...) free(t); return s; } - - diff --git a/src/cmd/auth/factotum/wep.c b/src/cmd/auth/factotum/wep.c index 1d516db2..701018e7 100644 --- a/src/cmd/auth/factotum/wep.c +++ b/src/cmd/auth/factotum/wep.c @@ -11,11 +11,11 @@ wepclient(Conv *c) char *dev, buf[128], *p, *kp; Key *k; int ret, fd, cfd; - + fd = cfd = -1; ret = -1; dev = nil; - + if((k = keylookup("%A !key1?", c->attr)) == nil && (k = keylookup("%A !key2?", c->attr)) == nil && (k = keylookup("%A !key3?", c->attr)) == nil){ @@ -73,7 +73,7 @@ static Role weproles[] = { 0 }; -Proto wep = +Proto wep = { "wep", weproles, diff --git a/src/cmd/auth/factotum/xio.c b/src/cmd/auth/factotum/xio.c index 2e6b141b..116fccaf 100644 --- a/src/cmd/auth/factotum/xio.c +++ b/src/cmd/auth/factotum/xio.c @@ -9,7 +9,7 @@ xioproc(void) { Ioproc *c; int i; - + for(i=0; i<ncache; i++){ if(c = cache[i]){ cache[i] = nil; @@ -162,4 +162,3 @@ xioasgetticket(int fd, char *trbuf, char *tbuf) n = 0; return n; } - |