diff options
author | ed <ed@FreeBSD.org> | 2009-02-26 21:43:15 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-02-26 21:43:15 +0000 |
commit | fa4082de198dcb08fb0798fdf991d3c880c765e3 (patch) | |
tree | 5b0afd074d7bb26b1e443eb2abbda20979f70b42 /usr.sbin/keyserv | |
parent | bb22735cfd8d9750d7d63bbe7a69bb5e7f68060c (diff) | |
download | FreeBSD-src-fa4082de198dcb08fb0798fdf991d3c880c765e3.zip FreeBSD-src-fa4082de198dcb08fb0798fdf991d3c880c765e3.tar.gz |
Rename all symbols in libmp(3) to mp_*, just like Solaris.
The function pow() in libmp(3) clashes with pow(3) in libm. We could
rename this single function, but we can just take the same approach as
the Solaris folks did, which is to prefix all function names with mp_.
libmp(3) isn't really popular nowadays. I suspect not a single
application in ports depends on it. There's still a chance, so I've
increased the SHLIB_MAJOR and __FreeBSD_version.
Reviewed by: deischen, rdivacky
Diffstat (limited to 'usr.sbin/keyserv')
-rw-r--r-- | usr.sbin/keyserv/Makefile | 2 | ||||
-rw-r--r-- | usr.sbin/keyserv/setkey.c | 40 |
2 files changed, 22 insertions, 20 deletions
diff --git a/usr.sbin/keyserv/Makefile b/usr.sbin/keyserv/Makefile index 54075da..37a416f 100644 --- a/usr.sbin/keyserv/Makefile +++ b/usr.sbin/keyserv/Makefile @@ -9,6 +9,8 @@ CFLAGS+= -DKEYSERV_RANDOM -DBROKEN_DES -I. DPADD= ${LIBMP} ${LIBCRYPTO} ${LIBRPCSVC} LDADD= -lmp -lcrypto -lrpcsvc +WARNS?= 1 + RPCDIR= ${DESTDIR}/usr/include/rpcsvc CLEANFILES= crypt_svc.c crypt.h diff --git a/usr.sbin/keyserv/setkey.c b/usr.sbin/keyserv/setkey.c index 046a358..a11d04d 100644 --- a/usr.sbin/keyserv/setkey.c +++ b/usr.sbin/keyserv/setkey.c @@ -84,7 +84,7 @@ void setmodulus(modx) char *modx; { - MODULUS = xtom(modx); + MODULUS = mp_xtom(modx); } /* @@ -198,19 +198,19 @@ pk_crypt(uid, remote_name, remote_key, key, mode) } if (!readcache(xpublic, xsecret, &deskey)) { - public = xtom(xpublic); - secret = xtom(xsecret); + public = mp_xtom(xpublic); + secret = mp_xtom(xsecret); /* Sanity Check on public and private keys */ if ((public == NULL) || (secret == NULL)) return (KEY_SYSTEMERR); - common = itom(0); - pow(public, secret, MODULUS, common); + common = mp_itom(0); + mp_pow(public, secret, MODULUS, common); extractdeskey(common, &deskey); writecache(xpublic, xsecret, &deskey); - mfree(secret); - mfree(public); - mfree(common); + mp_mfree(secret); + mp_mfree(public); + mp_mfree(common); } err = ecb_crypt((char *)&deskey, (char *)key, sizeof (des_block), DES_HW | mode); @@ -248,19 +248,19 @@ pk_get_conv_key(uid, xpublic, result) } if (!readcache(xpublic, xsecret, &result->cryptkeyres_u.deskey)) { - public = xtom(xpublic); - secret = xtom(xsecret); + public = mp_xtom(xpublic); + secret = mp_xtom(xsecret); /* Sanity Check on public and private keys */ if ((public == NULL) || (secret == NULL)) return (KEY_SYSTEMERR); - common = itom(0); - pow(public, secret, MODULUS, common); + common = mp_itom(0); + mp_pow(public, secret, MODULUS, common); extractdeskey(common, &result->cryptkeyres_u.deskey); writecache(xpublic, xsecret, &result->cryptkeyres_u.deskey); - mfree(secret); - mfree(public); - mfree(common); + mp_mfree(secret); + mp_mfree(public); + mp_mfree(common); } return (KEY_SUCCESS); @@ -281,21 +281,21 @@ extractdeskey(ck, deskey) short base = (1 << 8); char *k; - a = itom(0); + a = mp_itom(0); #ifdef SOLARIS_MP _mp_move(ck, a); #else - move(ck, a); + mp_move(ck, a); #endif for (i = 0; i < ((KEYSIZE - 64) / 2) / 8; i++) { - sdiv(a, base, a, &r); + mp_sdiv(a, base, a, &r); } k = deskey->c; for (i = 0; i < 8; i++) { - sdiv(a, base, a, &r); + mp_sdiv(a, base, a, &r); *k++ = r; } - mfree(a); + mp_mfree(a); des_setparity((char *)deskey); } |