lower case

This commit is contained in:
rsc 2005-02-13 22:10:33 +00:00
parent 9bce1d1eed
commit 6acff93f3d
8 changed files with 51 additions and 6 deletions

View file

@ -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);

View file

@ -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,

44
src/cmd/auth/dsa2pub.c Normal file
View file

@ -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);
}

View file

@ -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);

View file

@ -6,6 +6,7 @@ TARG=\
asn12dsa\
asn12rsa\
dsagen\
dsa2pub\
dsa2ssh\
passwd\
pemdecode\

View file

@ -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)

View file

@ -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,

View file

@ -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,