(create_checksum): change so that `type == 0' means pick from the
`crypto' (context) and otherwise use that type. this is not a large change in practice and allows callers to specify the exact checksum algorithm to use git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9760 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
		| @@ -1404,19 +1404,20 @@ static krb5_error_code | ||||
| create_checksum(krb5_context context, | ||||
| 		krb5_crypto crypto, | ||||
| 		unsigned usage, /* not krb5_key_usage */ | ||||
| 		krb5_cksumtype type, /* if crypto == NULL */ | ||||
| 		krb5_cksumtype type, /* 0 -> pick from crypto */ | ||||
| 		void *data, | ||||
| 		size_t len, | ||||
| 		Checksum *result) | ||||
| { | ||||
|     struct checksum_type *ct; | ||||
|     struct checksum_type *ct = NULL; | ||||
|  | ||||
|     if(crypto) { | ||||
|     if (type) | ||||
| 	ct = _find_checksum(type); | ||||
|     else if(crypto) { | ||||
| 	ct = crypto->et->keyed_checksum; | ||||
| 	if(ct == NULL) | ||||
| 	    ct = crypto->et->cksumtype; | ||||
|     } else | ||||
| 	ct = _find_checksum(type); | ||||
|     } | ||||
|     if(ct == NULL) | ||||
| 	return KRB5_PROG_SUMTYPE_NOSUPP; | ||||
|     return do_checksum (context, ct, crypto, usage, data, len, result); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Assar Westerlund
					Assar Westerlund