summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/roken/unvis.c
diff options
context:
space:
mode:
authorstas <stas@FreeBSD.org>2012-03-22 08:48:42 +0000
committerstas <stas@FreeBSD.org>2012-03-22 08:48:42 +0000
commite7e0b349883e80d63c4e856f16351aaa6607766d (patch)
tree5518cb944fa25f627a797b58451ccf506b720fcf /crypto/heimdal/lib/roken/unvis.c
parente02fd6b8423e63f1fdbfc1f984d7c7291a1bacd1 (diff)
parent2db247d3fc10ef5304f61dbd66448efff8cc6684 (diff)
downloadFreeBSD-src-e7e0b349883e80d63c4e856f16351aaa6607766d.zip
FreeBSD-src-e7e0b349883e80d63c4e856f16351aaa6607766d.tar.gz
- Update FreeBSD Heimdal distribution to version 1.5.1. This also brings
several new kerberos related libraries and applications to FreeBSD: o kgetcred(1) allows one to manually get a ticket for a particular service. o kf(1) securily forwards ticket to another host through an authenticated and encrypted stream. o kcc(1) is an umbrella program around klist(1), kswitch(1), kgetcred(1) and other user kerberos operations. klist and kswitch are just symlinks to kcc(1) now. o kswitch(1) allows you to easily switch between kerberos credentials if you're running KCM. o hxtool(1) is a certificate management tool to use with PKINIT. o string2key(1) maps a password into key. o kdigest(8) is a userland tool to access the KDC's digest interface. o kimpersonate(8) creates a "fake" ticket for a service. We also now install manpages for some lirbaries that were not installed before, libheimntlm and libhx509. - The new HEIMDAL version no longer supports Kerberos 4. All users are recommended to switch to Kerberos 5. - Weak ciphers are now disabled by default. To enable DES support (used by telnet(8)), use "allow_weak_crypto" option in krb5.conf. - libtelnet, pam_ksu and pam_krb5 are now compiled with error on warnings disabled due to the function they use (krb5_get_err_text(3)) being deprecated. I plan to work on this next. - Heimdal's KDC now require sqlite to operate. We use the bundled version and install it as libheimsqlite. If some other FreeBSD components will require it in the future we can rename it to libbsdsqlite and use for these components as well. - This is not a latest Heimdal version, the new one was released while I was working on the update. I will update it to 1.5.2 soon, as it fixes some important bugs and security issues.
Diffstat (limited to 'crypto/heimdal/lib/roken/unvis.c')
-rw-r--r--crypto/heimdal/lib/roken/unvis.c45
1 files changed, 21 insertions, 24 deletions
diff --git a/crypto/heimdal/lib/roken/unvis.c b/crypto/heimdal/lib/roken/unvis.c
index 72d5f16..6ceda4a 100644
--- a/crypto/heimdal/lib/roken/unvis.c
+++ b/crypto/heimdal/lib/roken/unvis.c
@@ -30,10 +30,7 @@
*/
#if 1
-#ifdef HAVE_CONFIG_H
#include <config.h>
-RCSID("$Id: unvis.c 21005 2007-06-08 01:54:35Z lha $");
-#endif
#include "roken.h"
#ifndef _DIAGASSERT
#define _DIAGASSERT(X)
@@ -82,16 +79,16 @@ __warn_references(unvis,
#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7')
-int ROKEN_LIB_FUNCTION
+ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
rk_strunvis (char *, const char *);
-int ROKEN_LIB_FUNCTION
+ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
rk_unvis (char *, int, int *, int);
/*
* unvis - decode characters previously encoded by vis
*/
-int ROKEN_LIB_FUNCTION
+ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
rk_unvis(char *cp, int c, int *astate, int flag)
{
@@ -102,7 +99,7 @@ rk_unvis(char *cp, int c, int *astate, int flag)
if (*astate == S_OCTAL2 || *astate == S_OCTAL3) {
*astate = S_GROUND;
return (UNVIS_VALID);
- }
+ }
return (*astate == S_GROUND ? UNVIS_NOCHAR : UNVIS_SYNBAD);
}
@@ -113,7 +110,7 @@ rk_unvis(char *cp, int c, int *astate, int flag)
if (c == '\\') {
*astate = S_START;
return (0);
- }
+ }
*cp = c;
return (UNVIS_VALID);
@@ -129,7 +126,7 @@ rk_unvis(char *cp, int c, int *astate, int flag)
*astate = S_OCTAL2;
return (0);
case 'M':
- *cp = (char)0200;
+ *cp = (u_char)0200;
*astate = S_META;
return (0);
case '^':
@@ -186,7 +183,7 @@ rk_unvis(char *cp, int c, int *astate, int flag)
}
*astate = S_GROUND;
return (UNVIS_SYNBAD);
-
+
case S_META:
if (c == '-')
*astate = S_META1;
@@ -197,12 +194,12 @@ rk_unvis(char *cp, int c, int *astate, int flag)
return (UNVIS_SYNBAD);
}
return (0);
-
+
case S_META1:
*astate = S_GROUND;
*cp |= c;
return (UNVIS_VALID);
-
+
case S_CTRL:
if (c == '?')
*cp |= 0177;
@@ -213,15 +210,15 @@ rk_unvis(char *cp, int c, int *astate, int flag)
case S_OCTAL2: /* second possible octal digit */
if (isoctal(c)) {
- /*
- * yes - and maybe a third
+ /*
+ * yes - and maybe a third
*/
*cp = (*cp << 3) + (c - '0');
- *astate = S_OCTAL3;
+ *astate = S_OCTAL3;
return (0);
- }
- /*
- * no - done with current sequence, push back passed char
+ }
+ /*
+ * no - done with current sequence, push back passed char
*/
*astate = S_GROUND;
return (UNVIS_VALIDPUSH);
@@ -236,10 +233,10 @@ rk_unvis(char *cp, int c, int *astate, int flag)
* we were done, push back passed char
*/
return (UNVIS_VALIDPUSH);
-
- default:
- /*
- * decoder in unknown state - (probably uninitialized)
+
+ default:
+ /*
+ * decoder in unknown state - (probably uninitialized)
*/
*astate = S_GROUND;
return (UNVIS_SYNBAD);
@@ -247,13 +244,13 @@ rk_unvis(char *cp, int c, int *astate, int flag)
}
/*
- * strunvis - decode src into dst
+ * strunvis - decode src into dst
*
* Number of chars decoded into dst is returned, -1 on error.
* Dst is null terminated.
*/
-int ROKEN_LIB_FUNCTION
+ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
rk_strunvis(char *dst, const char *src)
{
char c;
OpenPOWER on IntegriCloud