diff options
author | rsc <devnull@localhost> | 2005-02-13 22:10:33 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-02-13 22:10:33 +0000 |
commit | 6acff93f3df9e47a0b4b05804e08d67f478b4e91 (patch) | |
tree | 8fb14f22b1e351f6963b34c5126ffa47c8f3c5af /src/cmd/auth | |
parent | 9bce1d1eed81595da741991b6cfa33832cf3e4d9 (diff) | |
download | plan9port-6acff93f3df9e47a0b4b05804e08d67f478b4e91.tar.gz plan9port-6acff93f3df9e47a0b4b05804e08d67f478b4e91.tar.bz2 plan9port-6acff93f3df9e47a0b4b05804e08d67f478b4e91.zip |
lower case
Diffstat (limited to 'src/cmd/auth')
-rw-r--r-- | src/cmd/auth/asn12dsa.c | 2 | ||||
-rw-r--r-- | src/cmd/auth/asn12rsa.c | 2 | ||||
-rw-r--r-- | src/cmd/auth/dsa2pub.c | 44 | ||||
-rw-r--r-- | src/cmd/auth/dsagen.c | 2 | ||||
-rw-r--r-- | src/cmd/auth/mkfile | 1 | ||||
-rw-r--r-- | src/cmd/auth/rsa2pub.c | 2 | ||||
-rw-r--r-- | src/cmd/auth/rsafill.c | 2 | ||||
-rw-r--r-- | src/cmd/auth/rsagen.c | 2 |
8 files changed, 51 insertions, 6 deletions
diff --git a/src/cmd/auth/asn12dsa.c b/src/cmd/auth/asn12dsa.c index 7df5dd78..793dbcdc 100644 --- a/src/cmd/auth/asn12dsa.c +++ b/src/cmd/auth/asn12dsa.c @@ -59,7 +59,7 @@ main(int argc, char **argv) if(key == nil) sysfatal("couldn't parse asn1 key"); - s = smprint("key proto=dsa %s%sp=%B q=%B alpha=%B key=%B !secret=%B\n", + s = smprint("key proto=dsa %s%sp=%lB q=%lB alpha=%lB key=%lB !secret=%lB\n", tag ? tag : "", tag ? " " : "", key->pub.p, key->pub.q, key->pub.alpha, key->pub.key, key->secret); diff --git a/src/cmd/auth/asn12rsa.c b/src/cmd/auth/asn12rsa.c index a2df0447..abddf8b4 100644 --- a/src/cmd/auth/asn12rsa.c +++ b/src/cmd/auth/asn12rsa.c @@ -59,7 +59,7 @@ main(int argc, char **argv) if(key == nil) sysfatal("couldn't parse asn1 key"); - s = smprint("key proto=rsa %s%ssize=%d ek=%B !dk=%B n=%B !p=%B !q=%B !kp=%B !kq=%B !c2=%B\n", + s = smprint("key proto=rsa %s%ssize=%d ek=%lB !dk=%lB n=%lB !p=%lB !q=%lB !kp=%lB !kq=%lB !c2=%lB\n", tag ? tag : "", tag ? " " : "", mpsignif(key->pub.n), key->pub.ek, key->dk, key->pub.n, key->p, key->q, diff --git a/src/cmd/auth/dsa2pub.c b/src/cmd/auth/dsa2pub.c new file mode 100644 index 00000000..37dc8328 --- /dev/null +++ b/src/cmd/auth/dsa2pub.c @@ -0,0 +1,44 @@ +#include <u.h> +#include <libc.h> +#include <auth.h> +#include <mp.h> +#include <libsec.h> +#include "rsa2any.h" + +void +usage(void) +{ + fprint(2, "usage: auth/dsa2pub [file]\n"); + exits("usage"); +} + +void +main(int argc, char **argv) +{ + RSApriv *key; + Attr *a; + char *s; + + fmtinstall('A', _attrfmt); + fmtinstall('B', mpfmt); + quotefmtinstall(); + + ARGBEGIN{ + default: + usage(); + }ARGEND + + if(argc > 1) + usage(); + + if((key = getdsakey(argc, argv, 0, &a)) == nil) + sysfatal("%r"); + + s = smprint("key %A p=%lB q=%lB alpha=%lB key=%lB\n", + a, + key->pub.p, key->pub.q, key->pub.alpha, key->pub.key); + if(s == nil) + sysfatal("smprint: %r"); + write(1, s, strlen(s)); + exits(nil); +} diff --git a/src/cmd/auth/dsagen.c b/src/cmd/auth/dsagen.c index 5fa9f99a..58d59247 100644 --- a/src/cmd/auth/dsagen.c +++ b/src/cmd/auth/dsagen.c @@ -36,7 +36,7 @@ main(int argc, char **argv) key = dsagen(nil); - s = smprint("key proto=dsa %s%sp=%B q=%B alpha=%B key=%B !secret=%B\n", + s = smprint("key proto=dsa %s%sp=%lB q=%lB alpha=%lB key=%lB !secret=%lB\n", tag ? tag : "", tag ? " " : "", key->pub.p, key->pub.q, key->pub.alpha, key->pub.key, key->secret); diff --git a/src/cmd/auth/mkfile b/src/cmd/auth/mkfile index 39d2f53a..2585456b 100644 --- a/src/cmd/auth/mkfile +++ b/src/cmd/auth/mkfile @@ -6,6 +6,7 @@ TARG=\ asn12dsa\ asn12rsa\ dsagen\ + dsa2pub\ dsa2ssh\ passwd\ pemdecode\ diff --git a/src/cmd/auth/rsa2pub.c b/src/cmd/auth/rsa2pub.c index 7de10506..c0a208a7 100644 --- a/src/cmd/auth/rsa2pub.c +++ b/src/cmd/auth/rsa2pub.c @@ -34,7 +34,7 @@ main(int argc, char **argv) if((key = getkey(argc, argv, 0, &a)) == nil) sysfatal("%r"); - s = smprint("key %A size=%d ek=%B n=%B\n", + s = smprint("key %A size=%d ek=%lB n=%lB\n", a, mpsignif(key->pub.n), key->pub.ek, key->pub.n); if(s == nil) diff --git a/src/cmd/auth/rsafill.c b/src/cmd/auth/rsafill.c index b9e26d43..08cb8599 100644 --- a/src/cmd/auth/rsafill.c +++ b/src/cmd/auth/rsafill.c @@ -34,7 +34,7 @@ main(int argc, char **argv) if((key = getkey(argc, argv, 1, &a)) == nil) sysfatal("%r"); - s = smprint("key %A size=%d ek=%B !dk=%B n=%B !p=%B !q=%B !kp=%B !kq=%B !c2=%B\n", + s = smprint("key %A size=%d ek=%lB !dk=%lB n=%lB !p=%lB !q=%lB !kp=%lB !kq=%lB !c2=%lB\n", a, mpsignif(key->pub.n), key->pub.ek, key->dk, key->pub.n, key->p, key->q, diff --git a/src/cmd/auth/rsagen.c b/src/cmd/auth/rsagen.c index d05f562e..d51560b6 100644 --- a/src/cmd/auth/rsagen.c +++ b/src/cmd/auth/rsagen.c @@ -45,7 +45,7 @@ main(int argc, char **argv) key = rsagen(bits, 6, 0); }while(mpsignif(key->pub.n) != bits); - s = smprint("key proto=rsa %s%ssize=%d ek=%B !dk=%B n=%B !p=%B !q=%B !kp=%B !kq=%B !c2=%B\n", + s = smprint("key proto=rsa %s%ssize=%d ek=%lB !dk=%lB n=%lB !p=%lB !q=%lB !kp=%lB !kq=%lB !c2=%lB\n", tag ? tag : "", tag ? " " : "", mpsignif(key->pub.n), key->pub.ek, key->dk, key->pub.n, key->p, key->q, |