diff options
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/asn.1/ChangeLog | 10 | ||||
-rw-r--r-- | src/tests/asn.1/krb5_encode_test.c | 4 | ||||
-rw-r--r-- | src/tests/asn.1/ktest.c | 17 | ||||
-rw-r--r-- | src/tests/asn.1/trval.c | 24 | ||||
-rw-r--r-- | src/tests/asn.1/utility.c | 6 |
5 files changed, 39 insertions, 22 deletions
diff --git a/src/tests/asn.1/ChangeLog b/src/tests/asn.1/ChangeLog index c10d982ea..3d03f1a4f 100644 --- a/src/tests/asn.1/ChangeLog +++ b/src/tests/asn.1/ChangeLog @@ -1,3 +1,13 @@ +2000-07-28 Ezra Peisach <epeisach@mit.edu> + + * utility.c: Add casts on types being sent to internal functions. + + * krb5_encode_test.c: Declare internal functions as static. + + * ktest.c: Remove unused functions. Clean up compiler warnings. + + * trval.c: Add proper prototype for declared functions. + 1999-11-01 Tom Yu <tlyu@mit.edu> * krb5_decode_test.c (main): Add test case for zero-length diff --git a/src/tests/asn.1/krb5_encode_test.c b/src/tests/asn.1/krb5_encode_test.c index e02fe743b..012be90b4 100644 --- a/src/tests/asn.1/krb5_encode_test.c +++ b/src/tests/asn.1/krb5_encode_test.c @@ -15,7 +15,7 @@ int error_count = 0; int do_trval = 0; int trval2(); -void encoder_print_results(code, typestring, description) +static void encoder_print_results(code, typestring, description) krb5_data *code; char *typestring; char *description; @@ -52,7 +52,7 @@ void encoder_print_results(code, typestring, description) ktest_destroy_data(&code); } -void PRS(argc, argv) +static void PRS(argc, argv) int argc; char **argv; { diff --git a/src/tests/asn.1/ktest.c b/src/tests/asn.1/ktest.c index 8e60c181d..9e4a4521c 100644 --- a/src/tests/asn.1/ktest.c +++ b/src/tests/asn.1/ktest.c @@ -629,16 +629,7 @@ krb5_error_code ktest_make_sample_alt_method(p) { p->method = 42; p->data = (krb5_octet *) "secret"; - p->length = strlen(p->data); - return 0; -} - -krb5_error_code ktest_make_sample_etype_info_entry(p) - krb5_etype_info_entry * p; -{ - p->etype = 1; - p->salt = (krb5_octet *) "Morton"; - p->length = strlen(p->salt); + p->length = strlen((char *) p->data); return 0; } @@ -661,10 +652,10 @@ krb5_error_code ktest_make_sample_etype_info(p) info[i]->etype = i; sprintf(buf, "Morton's #%d", i); info[i]->length = strlen(buf); - info[i]->salt = malloc(info[i]->length+1); + info[i]->salt = malloc((size_t) (info[i]->length+1)); if (info[i]->salt == 0) goto memfail; - strcpy(info[i]->salt, buf); + strcpy((char *) info[i]->salt, buf); info[i]->magic = KV5M_ETYPE_INFO_ENTRY; } free(info[1]->salt); @@ -883,12 +874,14 @@ void ktest_destroy_sequence_of_integer(soi) *soi = NULL; } +#if 0 void ktest_destroy_sequence_of_enctype(soi) krb5_enctype ** soi; { free(*soi); *soi = NULL; } +#endif void ktest_destroy_sequence_of_ticket(sot) krb5_ticket *** sot; diff --git a/src/tests/asn.1/trval.c b/src/tests/asn.1/trval.c index fb3e4ea9b..6c1608c45 100644 --- a/src/tests/asn.1/trval.c +++ b/src/tests/asn.1/trval.c @@ -105,14 +105,28 @@ int print_krb5_types = 0; int current_appl_type = -1; -void print_tag_type(); -int trval(), trval2(), decode_len(), do_cons(), do_prim(); +#if (defined(__STDC__) || defined(__cplusplus) || defined(_MSDOS) || defined(_WIN32) || defined(KRB5_PROVIDE_PROTOTYPES)) && !defined(KRB5_NO_PROTOTYPES) +#define PROTOTYPE(x) x +#else +#define PROTOTYPE(x) () +#endif + + +int decode_len PROTOTYPE((FILE *, unsigned char *, int)); +int do_prim PROTOTYPE((FILE *, int, unsigned char *, int, int)); +int do_cons PROTOTYPE((FILE *, unsigned char *, int, int, int *)); +int do_prim_bitstring PROTOTYPE((FILE *, int, unsigned char *, int, int)); +int do_prim_int PROTOTYPE((FILE *, int, unsigned char *, int, int)); +int do_prim_string PROTOTYPE((FILE *, int, unsigned char *, int, int)); +void print_tag_type PROTOTYPE((FILE *, int, int)); +int trval(), trval2(); + /****************************************************************************/ #ifdef STANDALONE -void usage() +static void usage() { fprintf(stderr, "Usage: trval [--types] [--krb5] [--krb5decode] [--hex] [-notypebytes] [file]\n"); exit(1); @@ -182,7 +196,7 @@ int main(argc, argv) } #endif -int convert_nibble(ch) +static int convert_nibble(ch) { if (isdigit(ch)) return (ch - '0'); @@ -490,7 +504,7 @@ struct typestring_table { int new_appl; }; -char *lookup_typestring(table, key1, key2) +static char *lookup_typestring(table, key1, key2) struct typestring_table *table; int key1, key2; { diff --git a/src/tests/asn.1/utility.c b/src/tests/asn.1/utility.c index 739d63913..0831a0864 100644 --- a/src/tests/asn.1/utility.c +++ b/src/tests/asn.1/utility.c @@ -22,11 +22,11 @@ asn1_error_code asn1_krb5_data_unparse(code, s) }else{ int i; - *s = (char*)calloc(3*(code->length), sizeof(char)); + *s = (char*)calloc((size_t) 3*(code->length), sizeof(char)); if(*s == NULL) return ENOMEM; for(i = 0; i < code->length; i++){ - (*s)[3*i] = hexchar(((code->data)[i]&0xF0)>>4); - (*s)[3*i+1] = hexchar((code->data)[i]&0x0F); + (*s)[3*i] = hexchar((unsigned char) (((code->data)[i]&0xF0)>>4)); + (*s)[3*i+1] = hexchar((unsigned char) ((code->data)[i]&0x0F)); (*s)[3*i+2] = ' '; } (*s)[3*(code->length)-1] = '\0'; |