use unsigned int as counter to fit better with the asn1 compiler

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19166 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-11-28 03:59:34 +00:00
parent 5b304e5f20
commit 444753045a
2 changed files with 19 additions and 15 deletions

View File

@@ -2139,9 +2139,11 @@ hx509_crypto_select(const hx509_context context,
def = hx509_signature_sha1(); def = hx509_signature_sha1();
} else if (type == HX509_SELECT_PUBLIC_SIG) { } else if (type == HX509_SELECT_PUBLIC_SIG) {
bits = SIG_PUBLIC_SIG; bits = SIG_PUBLIC_SIG;
def = hx509_signature_rsa_with_sha1(); /* XXX depend on `source<63> and `peer<65> */ /* XXX depend on `source<63> and `peer<65> */
def = hx509_signature_rsa_with_sha1();
} else { } else {
hx509_set_error_string(context, 0, EINVAL, "unknown type %d of selection", type); hx509_set_error_string(context, 0, EINVAL,
"Unknown type %d of selection", type);
return EINVAL; return EINVAL;
} }
@@ -2152,7 +2154,8 @@ hx509_crypto_select(const hx509_context context,
for (j = 0; sig_algs[j]; j++) { for (j = 0; sig_algs[j]; j++) {
if ((sig_algs[j]->flags & bits) != bits) if ((sig_algs[j]->flags & bits) != bits)
continue; continue;
if (der_heim_oid_cmp((*sig_algs[j]->sig_oid)(), &peer->val[i].algorithm) != 0) if (der_heim_oid_cmp((*sig_algs[j]->sig_oid)(),
&peer->val[i].algorithm) != 0)
continue; continue;
if (keytype && sig_algs[j]->key_oid && if (keytype && sig_algs[j]->key_oid &&
der_heim_oid_cmp(keytype, (*sig_algs[j]->key_oid)())) der_heim_oid_cmp(keytype, (*sig_algs[j]->key_oid)()))
@@ -2179,10 +2182,10 @@ hx509_crypto_available(hx509_context context,
int type, int type,
hx509_cert source, hx509_cert source,
AlgorithmIdentifier **val, AlgorithmIdentifier **val,
size_t *plen) unsigned int *plen)
{ {
const heim_oid *keytype = NULL; const heim_oid *keytype = NULL;
size_t len, i; unsigned int len, i;
void *ptr; void *ptr;
int bits, ret; int bits, ret;
@@ -2195,7 +2198,8 @@ hx509_crypto_available(hx509_context context,
} else if (type == HX509_SELECT_PUBLIC_SIG) { } else if (type == HX509_SELECT_PUBLIC_SIG) {
bits = SIG_PUBLIC_SIG; bits = SIG_PUBLIC_SIG;
} else { } else {
hx509_set_error_string(context, 0, EINVAL, "unknown type %d of available", type); hx509_set_error_string(context, 0, EINVAL,
"Unknown type %d of available", type);
return EINVAL; return EINVAL;
} }
@@ -2238,9 +2242,9 @@ out:
void void
hx509_crypto_free_algs(AlgorithmIdentifier *val, hx509_crypto_free_algs(AlgorithmIdentifier *val,
size_t len) unsigned int len)
{ {
size_t i; unsigned int i;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
free_AlgorithmIdentifier(&val[i]); free_AlgorithmIdentifier(&val[i]);
free(val); free(val);

View File

@@ -993,10 +993,9 @@ random_data(void *opt, int argc, char **argv)
int int
crypto_available(struct crypto_available_options *opt, int argc, char **argv) crypto_available(struct crypto_available_options *opt, int argc, char **argv)
{ {
int ret;
size_t len, i;
AlgorithmIdentifier *val; AlgorithmIdentifier *val;
int type = HX509_SELECT_ALL; unsigned int len, i;
int ret, type;
if (opt->type_string) { if (opt->type_string) {
if (strcmp(opt->type_string, "all") == 0) if (strcmp(opt->type_string, "all") == 0)
@@ -1007,7 +1006,8 @@ crypto_available(struct crypto_available_options *opt, int argc, char **argv)
type = HX509_SELECT_PUBLIC_SIG; type = HX509_SELECT_PUBLIC_SIG;
else else
errx(1, "unknown type: %s", opt->type_string); errx(1, "unknown type: %s", opt->type_string);
} } else
type = HX509_SELECT_ALL;
ret = hx509_crypto_available(context, type, NULL, &val, &len); ret = hx509_crypto_available(context, type, NULL, &val, &len);
if (ret) if (ret)
@@ -1030,9 +1030,8 @@ crypto_select(struct crypto_select_options *opt, int argc, char **argv)
{ {
hx509_peer_info peer = NULL; hx509_peer_info peer = NULL;
AlgorithmIdentifier selected; AlgorithmIdentifier selected;
int ret; int ret, type;
char *s; char *s;
int type = HX509_SELECT_DIGEST;
if (opt->type_string) { if (opt->type_string) {
if (strcmp(opt->type_string, "digest") == 0) if (strcmp(opt->type_string, "digest") == 0)
@@ -1041,7 +1040,8 @@ crypto_select(struct crypto_select_options *opt, int argc, char **argv)
type = HX509_SELECT_PUBLIC_SIG; type = HX509_SELECT_PUBLIC_SIG;
else else
errx(1, "unknown type: %s", opt->type_string); errx(1, "unknown type: %s", opt->type_string);
} } else
type = HX509_SELECT_DIGEST;
if (opt->peer_cmstype_strings.num_strings) { if (opt->peer_cmstype_strings.num_strings) {
AlgorithmIdentifier *val; AlgorithmIdentifier *val;