2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

Rewrote the INSIST in dns_tsigkey_create() so that dstalg was guaranteed to

be set, even when INSISTS() are turned off.
This commit is contained in:
David Lawrence
2000-08-16 00:18:30 +00:00
parent 997e3113b7
commit beea173d49

View File

@@ -16,7 +16,7 @@
*/ */
/* /*
* $Id: tsig.c,v 1.84 2000/08/14 21:59:59 bwelling Exp $ * $Id: tsig.c,v 1.85 2000/08/16 00:18:30 tale Exp $
* Principal Author: Brian Wellington * Principal Author: Brian Wellington
*/ */
@@ -144,10 +144,14 @@ dns_tsigkey_create(dns_name_t *name, dns_name_t *algorithm,
if (length > 0) { if (length > 0) {
int dstalg; int dstalg;
if (tkey->algorithm == dns_tsig_hmacmd5_name) /*
dstalg = DST_ALG_HMACMD5; * Any algorithm other than HMACMD5 should have received an
else * ISC_R_NOTIMPLEMENTED result above.
INSIST(0); */
INSIST(tkey->algorithm == dns_tsig_hmacmd5_name);
dstalg = DST_ALG_HMACMD5;
isc_buffer_init(&b, secret, length); isc_buffer_init(&b, secret, length);
isc_buffer_add(&b, length); isc_buffer_add(&b, length);
ret = dst_key_frombuffer(name, dstalg, ret = dst_key_frombuffer(name, dstalg,