diff options
author | Ed Schouten <ed@FreeBSD.org> | 2009-02-26 21:43:15 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2009-02-26 21:43:15 +0000 |
commit | b3aaa0cc21c63d388230c7ef2a80abd631ff20d5 (patch) | |
tree | 5b0afd074d7bb26b1e443eb2abbda20979f70b42 /usr.sbin/keyserv | |
parent | 69328334a6c7118506ce7c7b4ab153e0b79b8fda (diff) |
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
Notes
Notes:
svn path=/head/; revision=189092
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 54075da67638..37a416f8dfc5 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 046a358c56f2..a11d04d4babe 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); } |