diff options
| author | Keith Vetter <keithv@fusion.com> | 1995-03-08 04:44:54 +0000 |
|---|---|---|
| committer | Keith Vetter <keithv@fusion.com> | 1995-03-08 04:44:54 +0000 |
| commit | cbcf193b26d7e61b2492b5b969ec031759876d00 (patch) | |
| tree | c2621be20e73b51386960e46806be321ce3b135e /src/lib/gssapi/generic | |
| parent | e6c3b9aa03e6946c93299d6d04ba4512e358729a (diff) | |
| download | krb5-cbcf193b26d7e61b2492b5b969ec031759876d00.tar.gz krb5-cbcf193b26d7e61b2492b5b969ec031759876d00.tar.xz krb5-cbcf193b26d7e61b2492b5b969ec031759876d00.zip | |
Fixed up some missing protocols and unchecked casts
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5084 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/gssapi/generic')
| -rw-r--r-- | src/lib/gssapi/generic/ChangeLog | 8 | ||||
| -rw-r--r-- | src/lib/gssapi/generic/disp_major_status.c | 7 | ||||
| -rw-r--r-- | src/lib/gssapi/generic/gssapiP_generic.h | 8 | ||||
| -rw-r--r-- | src/lib/gssapi/generic/util_canonhost.c | 7 | ||||
| -rw-r--r-- | src/lib/gssapi/generic/util_dup.c | 1 | ||||
| -rw-r--r-- | src/lib/gssapi/generic/util_token.c | 6 |
6 files changed, 26 insertions, 11 deletions
diff --git a/src/lib/gssapi/generic/ChangeLog b/src/lib/gssapi/generic/ChangeLog index 2a8c9677e..325109f01 100644 --- a/src/lib/gssapi/generic/ChangeLog +++ b/src/lib/gssapi/generic/ChangeLog @@ -1,3 +1,11 @@ +Tue Mar 7 20:14:53 1995 Keith Vetter (keithv@fusion.com) + + * disp_maj.c: added casts on int->long assignments. + * util_can.c: made to work with PC winsockets. + * util_dup.c: added system include for prototype info. + * util_tok.c: int/long problems. + * gssapip_.h: added casts on int->char assignments. + Tue Feb 28 00:25:58 1995 John Gilmore (gnu at toad.com) * gssapi.h: Avoid <krb5/...> includes. diff --git a/src/lib/gssapi/generic/disp_major_status.c b/src/lib/gssapi/generic/disp_major_status.c index d37b34e88..7dadd3e10 100644 --- a/src/lib/gssapi/generic/disp_major_status.c +++ b/src/lib/gssapi/generic/disp_major_status.c @@ -21,6 +21,7 @@ */ #include "gssapiP_generic.h" +#include <string.h> /* This code has knowledge of the min and max errors of each type within the gssapi major status */ @@ -278,20 +279,20 @@ OM_uint32 INTERFACE g_display_major_status(minor_status, status_value, if (!tmp) { /* bogon input - there should be something left */ - *minor_status = G_BAD_MSG_CTX; + *minor_status = (OM_uint32) G_BAD_MSG_CTX; return(GSS_S_FAILURE); } /* compute the bit offset */ /*SUPPRESS 570*/ - for (bit=0; (1<<bit) != LSBGET(tmp); bit++) ; + for (bit=0; (((OM_uint32) 1)<<bit) != LSBGET(tmp); bit++) ; /* print it */ if (ret = display_bit(minor_status, bit, status_string)) return(ret); /* compute the new status_value/message_context */ - status_value -= 1<<bit; + status_value -= ((OM_uint32) 1)<<bit; if (status_value) { *message_context = bit+3; diff --git a/src/lib/gssapi/generic/gssapiP_generic.h b/src/lib/gssapi/generic/gssapiP_generic.h index 54a25f783..d8d86bb6a 100644 --- a/src/lib/gssapi/generic/gssapiP_generic.h +++ b/src/lib/gssapi/generic/gssapiP_generic.h @@ -40,10 +40,10 @@ things */ #define TWRITE_INT(ptr, num, bigend) \ - (ptr)[0] = (bigend)?((num)>>24):((num)&0xff); \ - (ptr)[1] = (bigend)?(((num)>>16)&0xff):(((num)>>8)&0xff); \ - (ptr)[2] = (bigend)?(((num)>>8)&0xff):(((num)>>16)&0xff); \ - (ptr)[3] = (bigend)?((num)&0xff):((num)>>24); \ + (ptr)[0] = (char) ((bigend)?((num)>>24):((num)&0xff)); \ + (ptr)[1] = (char) ((bigend)?(((num)>>16)&0xff):(((num)>>8)&0xff)); \ + (ptr)[2] = (char) ((bigend)?(((num)>>8)&0xff):(((num)>>16)&0xff)); \ + (ptr)[3] = (char) ((bigend)?((num)&0xff):((num)>>24)); \ (ptr) += 4; #define TREAD_INT(ptr, num, bigend) \ diff --git a/src/lib/gssapi/generic/util_canonhost.c b/src/lib/gssapi/generic/util_canonhost.c index 89de87a02..1a82c96d3 100644 --- a/src/lib/gssapi/generic/util_canonhost.c +++ b/src/lib/gssapi/generic/util_canonhost.c @@ -21,12 +21,16 @@ */ /* This file could be OS specific */ +#define NEED_SOCKETS #include "gssapiP_generic.h" -#ifndef _MSDOS + #include <sys/types.h> +#ifndef _WINSOCKAPI_ #include <sys/socket.h> #include <netdb.h> +#endif #include <ctype.h> +#include <string.h> char * INTERFACE g_canonicalize_host(hostname) @@ -61,4 +65,3 @@ g_canonicalize_host(hostname) return(canon); } -#endif diff --git a/src/lib/gssapi/generic/util_dup.c b/src/lib/gssapi/generic/util_dup.c index e3e3e52a6..d6ce11824 100644 --- a/src/lib/gssapi/generic/util_dup.c +++ b/src/lib/gssapi/generic/util_dup.c @@ -21,6 +21,7 @@ */ #include "gssapiP_generic.h" +#include <string.h> char * INTERFACE g_strdup(str) char *str; diff --git a/src/lib/gssapi/generic/util_token.c b/src/lib/gssapi/generic/util_token.c index 424125d5d..c5067fde9 100644 --- a/src/lib/gssapi/generic/util_token.c +++ b/src/lib/gssapi/generic/util_token.c @@ -116,7 +116,7 @@ int INTERFACE g_token_size(mech, body_size) unsigned int body_size; { /* set body_size to sequence contents size */ - body_size += 4 + mech->length; + body_size += 4 + (int) mech->length; /* NEED overflow check */ return(1 + der_length_size(body_size) + body_size); } @@ -172,7 +172,9 @@ int INTERFACE g_verify_token_header(mech, body_size, buf, tok_type, toksize) return(0); toid.length = *(*buf)++; - if ((toksize-=toid.length) < 0) + if ((toid.length & VALID_INT_BITS) != toid.length) /* Overflow??? */ + return(0); + if ((toksize-= (int) toid.length) < 0) return(0); toid.elements = *buf; (*buf)+=toid.length; |
