mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-01 04:50:50 -05:00
4675. [cleanup] Don't use C++ keyword class. [RT #45726]
This commit is contained in:
parent
b2a5df8d4b
commit
ff8d856db0
9 changed files with 86 additions and 80 deletions
2
CHANGES
2
CHANGES
|
|
@ -1,3 +1,5 @@
|
|||
4675. [cleanup] Don't use C++ keyword class. [RT #45726]
|
||||
|
||||
4674. [func] "dig +sigchase", and related options "+topdown" and
|
||||
"+trusted-keys", have been removed. Use "delv" for
|
||||
queries with DNSSEC validation. [RT #42793]
|
||||
|
|
|
|||
|
|
@ -2134,7 +2134,7 @@ wrap_jsonfree(isc_buffer_t *buffer, void *arg) {
|
|||
}
|
||||
|
||||
static json_object *
|
||||
addzone(char *name, char *class, const char *ztype,
|
||||
addzone(char *name, char *classname, const char *ztype,
|
||||
isc_uint32_t serial, isc_boolean_t add_serial)
|
||||
{
|
||||
json_object *node = json_object_new_object();
|
||||
|
|
@ -2143,7 +2143,8 @@ addzone(char *name, char *class, const char *ztype,
|
|||
return (NULL);
|
||||
|
||||
json_object_object_add(node, "name", json_object_new_string(name));
|
||||
json_object_object_add(node, "class", json_object_new_string(class));
|
||||
json_object_object_add(node, "class",
|
||||
json_object_new_string(classname));
|
||||
if (add_serial)
|
||||
json_object_object_add(node, "serial",
|
||||
json_object_new_int64(serial));
|
||||
|
|
@ -2157,7 +2158,7 @@ static isc_result_t
|
|||
zone_jsonrender(dns_zone_t *zone, void *arg) {
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
char buf[1024 + 32]; /* sufficiently large for zone name and class */
|
||||
char class[1024 + 32]; /* sufficiently large for zone name and class */
|
||||
char classbuf[64]; /* sufficiently large for class */
|
||||
char *zone_name_only = NULL;
|
||||
char *class_only = NULL;
|
||||
dns_rdataclass_t rdclass;
|
||||
|
|
@ -2177,8 +2178,8 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
|
|||
zone_name_only = buf;
|
||||
|
||||
rdclass = dns_zone_getclass(zone);
|
||||
dns_rdataclass_format(rdclass, class, sizeof(class));
|
||||
class_only = class;
|
||||
dns_rdataclass_format(rdclass, classbuf, sizeof(classbuf));
|
||||
class_only = classbuf;
|
||||
|
||||
if (dns_zone_getserial2(zone, &serial) != ISC_R_SUCCESS)
|
||||
zoneobj = addzone(zone_name_only, class_only,
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include <tests/t_api.h>
|
||||
|
||||
static isc_result_t
|
||||
t_create(const char *db_type, const char *origin, const char *class,
|
||||
t_create(const char *db_type, const char *origin, const char *classname,
|
||||
const char *model, isc_mem_t *mctx, dns_db_t **db)
|
||||
{
|
||||
int len;
|
||||
|
|
@ -59,8 +59,8 @@ t_create(const char *db_type, const char *origin, const char *class,
|
|||
return(dns_result);
|
||||
}
|
||||
|
||||
DE_CONST(class, region.base);
|
||||
region.length = strlen(class);
|
||||
DE_CONST(classname, region.base);
|
||||
region.length = strlen(classname);
|
||||
dns_result = dns_rdataclass_fromtext(&rdataclass, ®ion);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
t_info("dns_rdataclass_fromtext failed %s\n",
|
||||
|
|
@ -85,7 +85,7 @@ t_dns_db_load(char **av) {
|
|||
char *db_type;
|
||||
char *origin;
|
||||
char *model;
|
||||
char *class;
|
||||
char *db_class;
|
||||
char *expected_load_result;
|
||||
char *findname;
|
||||
char *find_type;
|
||||
|
|
@ -116,7 +116,7 @@ t_dns_db_load(char **av) {
|
|||
db_type = T_ARG(1);
|
||||
origin = T_ARG(2);
|
||||
model = T_ARG(3);
|
||||
class = T_ARG(4);
|
||||
db_class = T_ARG(4);
|
||||
expected_load_result = T_ARG(5);
|
||||
findname = T_ARG(6);
|
||||
find_type = T_ARG(7);
|
||||
|
|
@ -151,7 +151,7 @@ t_dns_db_load(char **av) {
|
|||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
dns_result = t_create(db_type, origin, class, model, mctx, &db);
|
||||
dns_result = t_create(db_type, origin, db_class, model, mctx, &db);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
isc_hash_destroy();
|
||||
isc_entropy_detach(&ectx);
|
||||
|
|
@ -266,7 +266,7 @@ static const char *a2 =
|
|||
"dns_db_iscache(db) returns ISC_TRUE.";
|
||||
|
||||
static int
|
||||
t_dns_db_zc_x(char *filename, char *db_type, char *origin, char *class,
|
||||
t_dns_db_zc_x(char *filename, char *db_type, char *origin, char *db_class,
|
||||
dns_dbtype_t dbtype, isc_boolean_t(*cf)(dns_db_t *),
|
||||
isc_boolean_t exp_result)
|
||||
{
|
||||
|
|
@ -300,8 +300,8 @@ t_dns_db_zc_x(char *filename, char *db_type, char *origin, char *class,
|
|||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
textregion.base = class;
|
||||
textregion.length = strlen(class);
|
||||
textregion.base = db_class;
|
||||
textregion.length = strlen(db_class);
|
||||
dns_result = dns_rdataclass_fromtext(&rdataclass, &textregion);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
t_info("dns_rdataclass_fromtext failed %s\n",
|
||||
|
|
@ -622,7 +622,7 @@ static int
|
|||
t_dns_db_class(char **av) {
|
||||
|
||||
char *filename;
|
||||
char *class;
|
||||
char *db_class;
|
||||
|
||||
int result;
|
||||
isc_result_t dns_result;
|
||||
|
|
@ -635,16 +635,16 @@ t_dns_db_class(char **av) {
|
|||
isc_textregion_t textregion;
|
||||
|
||||
filename = T_ARG(0);
|
||||
class = T_ARG(1);
|
||||
db_class = T_ARG(1);
|
||||
db = NULL;
|
||||
mctx = NULL;
|
||||
ectx = NULL;
|
||||
|
||||
t_info("testing with database %s and class %s\n",
|
||||
filename, class);
|
||||
filename, db_class);
|
||||
|
||||
textregion.base = class;
|
||||
textregion.length = strlen(class);
|
||||
textregion.base = db_class;
|
||||
textregion.length = strlen(db_class);
|
||||
dns_result = dns_rdataclass_fromtext(&rdataclass, &textregion);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
t_info("dns_rdataclass_fromtext failed %s\n",
|
||||
|
|
@ -676,7 +676,7 @@ t_dns_db_class(char **av) {
|
|||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
dns_result = t_create("rbt", ".", class, "isc_true", mctx, &db);
|
||||
dns_result = t_create("rbt", ".", db_class, "isc_true", mctx, &db);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
t_info("t_create failed %s\n",
|
||||
dns_result_totext(dns_result));
|
||||
|
|
@ -705,7 +705,7 @@ t_dns_db_class(char **av) {
|
|||
dns_rdataclass_format(db_rdataclass,
|
||||
classbuf, sizeof(classbuf));
|
||||
t_info("dns_db_class returned %s, expected %s\n",
|
||||
classbuf, class);
|
||||
classbuf, db_class);
|
||||
result = T_FAIL;
|
||||
}
|
||||
|
||||
|
|
@ -735,7 +735,7 @@ t_dns_db_currentversion(char **av) {
|
|||
char *filename;
|
||||
char *db_type;
|
||||
char *origin;
|
||||
char *class;
|
||||
char *db_class;
|
||||
char *model;
|
||||
char *findname;
|
||||
char *findtype;
|
||||
|
|
@ -760,7 +760,7 @@ t_dns_db_currentversion(char **av) {
|
|||
filename = T_ARG(0);
|
||||
db_type = T_ARG(1);
|
||||
origin = T_ARG(2);
|
||||
class = T_ARG(3);
|
||||
db_class = T_ARG(3);
|
||||
model = T_ARG(4);
|
||||
findname = T_ARG(5);
|
||||
findtype = T_ARG(6);
|
||||
|
|
@ -794,7 +794,7 @@ t_dns_db_currentversion(char **av) {
|
|||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
dns_result = t_create(db_type, origin, class, model, mctx, &db);
|
||||
dns_result = t_create(db_type, origin, db_class, model, mctx, &db);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
isc_hash_destroy();
|
||||
isc_entropy_detach(&ectx);
|
||||
|
|
@ -1007,7 +1007,7 @@ t_dns_db_newversion(char **av) {
|
|||
char *filename;
|
||||
char *db_type;
|
||||
char *origin;
|
||||
char *class;
|
||||
char *db_class;
|
||||
char *model;
|
||||
char *newname;
|
||||
char *newtype;
|
||||
|
|
@ -1039,7 +1039,7 @@ t_dns_db_newversion(char **av) {
|
|||
filename = T_ARG(0);
|
||||
db_type = T_ARG(1);
|
||||
origin = T_ARG(2);
|
||||
class = T_ARG(3);
|
||||
db_class = T_ARG(3);
|
||||
model = T_ARG(4);
|
||||
newname = T_ARG(5);
|
||||
newtype = T_ARG(6);
|
||||
|
|
@ -1079,7 +1079,7 @@ t_dns_db_newversion(char **av) {
|
|||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
dns_result = t_create(db_type, origin, class, model, mctx, &db);
|
||||
dns_result = t_create(db_type, origin, db_class, model, mctx, &db);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
isc_hash_destroy();
|
||||
isc_entropy_detach(&ectx);
|
||||
|
|
@ -1151,8 +1151,8 @@ t_dns_db_newversion(char **av) {
|
|||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
textregion.base = class;
|
||||
textregion.length = strlen(class);
|
||||
textregion.base = db_class;
|
||||
textregion.length = strlen(db_class);
|
||||
dns_result = dns_rdataclass_fromtext(&rdataclass, &textregion);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
t_info("dns_rdataclass_fromtext failed %s\n",
|
||||
|
|
@ -1321,7 +1321,7 @@ t_dns_db_closeversion_1(char **av) {
|
|||
char *filename;
|
||||
char *db_type;
|
||||
char *origin;
|
||||
char *class;
|
||||
char *db_class;
|
||||
char *model;
|
||||
char *new_name;
|
||||
char *new_type;
|
||||
|
|
@ -1358,7 +1358,7 @@ t_dns_db_closeversion_1(char **av) {
|
|||
filename = T_ARG(0);
|
||||
db_type = T_ARG(1);
|
||||
origin = T_ARG(2);
|
||||
class = T_ARG(3);
|
||||
db_class = T_ARG(3);
|
||||
model = T_ARG(4);
|
||||
new_name = T_ARG(5);
|
||||
new_type = T_ARG(6);
|
||||
|
|
@ -1402,7 +1402,7 @@ t_dns_db_closeversion_1(char **av) {
|
|||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
dns_result = t_create(db_type, origin, class, model, mctx, &db);
|
||||
dns_result = t_create(db_type, origin, db_class, model, mctx, &db);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
isc_hash_destroy();
|
||||
isc_entropy_detach(&ectx);
|
||||
|
|
@ -1553,8 +1553,8 @@ t_dns_db_closeversion_1(char **av) {
|
|||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
textregion.base = class;
|
||||
textregion.length = strlen(class);
|
||||
textregion.base = db_class;
|
||||
textregion.length = strlen(db_class);
|
||||
dns_result = dns_rdataclass_fromtext(&rdataclass, &textregion);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
t_info("dns_rdataclass_fromtext failed %s\n",
|
||||
|
|
@ -1730,7 +1730,7 @@ t_dns_db_closeversion_2(char **av) {
|
|||
char *filename;
|
||||
char *db_type;
|
||||
char *origin;
|
||||
char *class;
|
||||
char *db_class;
|
||||
char *model;
|
||||
char *new_name;
|
||||
char *new_type;
|
||||
|
|
@ -1767,7 +1767,7 @@ t_dns_db_closeversion_2(char **av) {
|
|||
filename = T_ARG(0);
|
||||
db_type = T_ARG(1);
|
||||
origin = T_ARG(2);
|
||||
class = T_ARG(3);
|
||||
db_class = T_ARG(3);
|
||||
model = T_ARG(4);
|
||||
new_name = T_ARG(5);
|
||||
new_type = T_ARG(6);
|
||||
|
|
@ -1811,7 +1811,7 @@ t_dns_db_closeversion_2(char **av) {
|
|||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
dns_result = t_create(db_type, origin, class, model, mctx, &db);
|
||||
dns_result = t_create(db_type, origin, db_class, model, mctx, &db);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
isc_hash_destroy();
|
||||
isc_entropy_detach(&ectx);
|
||||
|
|
@ -1959,8 +1959,8 @@ t_dns_db_closeversion_2(char **av) {
|
|||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
textregion.base = class;
|
||||
textregion.length = strlen(class);
|
||||
textregion.base = db_class;
|
||||
textregion.length = strlen(db_class);
|
||||
dns_result = dns_rdataclass_fromtext(&rdataclass, &textregion);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
t_info("dns_rdataclass_fromtext failed %s\n",
|
||||
|
|
@ -2201,7 +2201,7 @@ t_dns_db_expirenode(char **av) {
|
|||
char *filename;
|
||||
char *db_type;
|
||||
char *origin;
|
||||
char *class;
|
||||
char *db_class;
|
||||
char *existing_name;
|
||||
char *node_xtime;
|
||||
char *find_xtime;
|
||||
|
|
@ -2227,7 +2227,7 @@ t_dns_db_expirenode(char **av) {
|
|||
filename = T_ARG(0);
|
||||
db_type = T_ARG(1);
|
||||
origin = T_ARG(2);
|
||||
class = T_ARG(3);
|
||||
db_class = T_ARG(3);
|
||||
existing_name = T_ARG(4);
|
||||
node_xtime = T_ARG(5);
|
||||
find_xtime = T_ARG(6);
|
||||
|
|
@ -2285,7 +2285,7 @@ t_dns_db_expirenode(char **av) {
|
|||
}
|
||||
|
||||
db = NULL;
|
||||
dns_result = t_create(db_type, origin, class, "cache", mctx, &db);
|
||||
dns_result = t_create(db_type, origin, db_class, "cache", mctx, &db);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
isc_hash_destroy();
|
||||
isc_entropy_detach(&ectx);
|
||||
|
|
@ -2404,7 +2404,7 @@ t_dns_db_findnode_1(char **av) {
|
|||
char *filename;
|
||||
char *db_type;
|
||||
char *origin;
|
||||
char *class;
|
||||
char *db_class;
|
||||
char *model;
|
||||
char *find_name;
|
||||
char *find_type;
|
||||
|
|
@ -2429,7 +2429,7 @@ t_dns_db_findnode_1(char **av) {
|
|||
filename = T_ARG(0);
|
||||
db_type = T_ARG(1);
|
||||
origin = T_ARG(2);
|
||||
class = T_ARG(3);
|
||||
db_class = T_ARG(3);
|
||||
model = T_ARG(4);
|
||||
find_name = T_ARG(5);
|
||||
find_type = T_ARG(6);
|
||||
|
|
@ -2476,7 +2476,7 @@ t_dns_db_findnode_1(char **av) {
|
|||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
dns_result = t_create(db_type, origin, class, model, mctx, &db);
|
||||
dns_result = t_create(db_type, origin, db_class, model, mctx, &db);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
isc_mem_destroy(&mctx);
|
||||
return(T_UNRESOLVED);
|
||||
|
|
@ -2576,7 +2576,7 @@ t_dns_db_findnode_2(char **av) {
|
|||
char *filename;
|
||||
char *db_type;
|
||||
char *origin;
|
||||
char *class;
|
||||
char *db_class;
|
||||
char *model;
|
||||
char *newname;
|
||||
|
||||
|
|
@ -2599,7 +2599,7 @@ t_dns_db_findnode_2(char **av) {
|
|||
filename = T_ARG(0);
|
||||
db_type = T_ARG(1);
|
||||
origin = T_ARG(2);
|
||||
class = T_ARG(3);
|
||||
db_class = T_ARG(3);
|
||||
model = T_ARG(4);
|
||||
newname = T_ARG(5);
|
||||
|
||||
|
|
@ -2631,7 +2631,7 @@ t_dns_db_findnode_2(char **av) {
|
|||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
dns_result = t_create(db_type, origin, class, model, mctx, &db);
|
||||
dns_result = t_create(db_type, origin, db_class, model, mctx, &db);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
isc_hash_destroy();
|
||||
isc_entropy_detach(&ectx);
|
||||
|
|
|
|||
|
|
@ -54,7 +54,8 @@ t1_add_callback(void *arg, const dns_name_t *owner, dns_rdataset_t *dataset) {
|
|||
}
|
||||
|
||||
static int
|
||||
test_master(char *testfile, char *origin, char *class, isc_result_t exp_result)
|
||||
test_master(char *testfile, char *origin, char *db_class,
|
||||
isc_result_t exp_result)
|
||||
{
|
||||
int result;
|
||||
int len;
|
||||
|
|
@ -94,8 +95,8 @@ test_master(char *testfile, char *origin, char *class, isc_result_t exp_result)
|
|||
dns_rdatacallbacks_init_stdio(&callbacks);
|
||||
callbacks.add = t1_add_callback;
|
||||
|
||||
textregion.base = class;
|
||||
textregion.length = strlen(class);
|
||||
textregion.base = db_class;
|
||||
textregion.length = strlen(db_class);
|
||||
|
||||
dns_result = dns_rdataclass_fromtext(&rdataclass, &textregion);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
|
|
|
|||
|
|
@ -1822,21 +1822,22 @@ dns_catz_update_from_db(dns_db_t *db, dns_catz_zones_t *catzs) {
|
|||
&rdataset);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
char cname[DNS_NAME_FORMATSIZE];
|
||||
char type[DNS_RDATATYPE_FORMATSIZE];
|
||||
char class[DNS_RDATACLASS_FORMATSIZE];
|
||||
char typebuf[DNS_RDATATYPE_FORMATSIZE];
|
||||
char classbuf[DNS_RDATACLASS_FORMATSIZE];
|
||||
|
||||
dns_name_format(name, cname,
|
||||
DNS_NAME_FORMATSIZE);
|
||||
dns_rdataclass_format(rdataset.rdclass, class,
|
||||
sizeof(class));
|
||||
dns_rdatatype_format(rdataset.type, type,
|
||||
sizeof(type));
|
||||
dns_rdataclass_format(rdataset.rdclass,
|
||||
classbuf,
|
||||
sizeof(classbuf));
|
||||
dns_rdatatype_format(rdataset.type, typebuf,
|
||||
sizeof(typebuf));
|
||||
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
|
||||
DNS_LOGMODULE_MASTER,
|
||||
ISC_LOG_WARNING,
|
||||
"catz: unknown record in catalog "
|
||||
"zone - %s %s %s(%s) - ignoring",
|
||||
cname, class, type,
|
||||
cname, classbuf, typebuf,
|
||||
isc_result_totext(result));
|
||||
}
|
||||
dns_rdataset_disassociate(&rdataset);
|
||||
|
|
|
|||
|
|
@ -4884,14 +4884,15 @@ same_question(fetchctx_t *fctx) {
|
|||
fctx->res->rdclass != rdataset->rdclass ||
|
||||
!dns_name_equal(&fctx->name, name)) {
|
||||
char namebuf[DNS_NAME_FORMATSIZE];
|
||||
char class[DNS_RDATACLASS_FORMATSIZE];
|
||||
char type[DNS_RDATATYPE_FORMATSIZE];
|
||||
char classbuf[DNS_RDATACLASS_FORMATSIZE];
|
||||
char typebuf[DNS_RDATATYPE_FORMATSIZE];
|
||||
|
||||
dns_name_format(name, namebuf, sizeof(namebuf));
|
||||
dns_rdataclass_format(rdataset->rdclass, class, sizeof(class));
|
||||
dns_rdatatype_format(rdataset->type, type, sizeof(type));
|
||||
dns_rdataclass_format(rdataset->rdclass, classbuf,
|
||||
sizeof(classbuf));
|
||||
dns_rdatatype_format(rdataset->type, typebuf, sizeof(typebuf));
|
||||
log_formerr(fctx, "question section mismatch: got %s/%s/%s",
|
||||
namebuf, class, type);
|
||||
namebuf, classbuf, typebuf);
|
||||
return (DNS_R_FORMERR);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -242,16 +242,16 @@ der_get_oid(const unsigned char *p, size_t len,
|
|||
oid * data, size_t * size);
|
||||
static int
|
||||
der_get_tag(const unsigned char *p, size_t len,
|
||||
Der_class * class, Der_type * type,
|
||||
Der_class * xclass, Der_type * type,
|
||||
int *tag, size_t * size);
|
||||
|
||||
static int
|
||||
der_match_tag(const unsigned char *p, size_t len,
|
||||
Der_class class, Der_type type,
|
||||
Der_class xclass, Der_type type,
|
||||
int tag, size_t * size);
|
||||
static int
|
||||
der_match_tag_and_length(const unsigned char *p, size_t len,
|
||||
Der_class class, Der_type type, int tag,
|
||||
Der_class xclass, Der_type type, int tag,
|
||||
size_t * length_ret, size_t * size);
|
||||
|
||||
static int
|
||||
|
|
@ -277,7 +277,7 @@ static int
|
|||
der_put_oid(unsigned char *p, size_t len,
|
||||
const oid * data, size_t * size);
|
||||
static int
|
||||
der_put_tag(unsigned char *p, size_t len, Der_class class, Der_type type,
|
||||
der_put_tag(unsigned char *p, size_t len, Der_class xclass, Der_type type,
|
||||
int tag, size_t *);
|
||||
static int
|
||||
der_put_length_and_tag(unsigned char *, size_t, size_t,
|
||||
|
|
@ -901,12 +901,12 @@ der_get_oid(const unsigned char *p, size_t len,
|
|||
|
||||
static int
|
||||
der_get_tag(const unsigned char *p, size_t len,
|
||||
Der_class *class, Der_type *type,
|
||||
Der_class *xclass, Der_type *type,
|
||||
int *tag, size_t *size)
|
||||
{
|
||||
if (len < 1U)
|
||||
return (ASN1_OVERRUN);
|
||||
*class = (Der_class) (((*p) >> 6) & 0x03);
|
||||
*xclass = (Der_class) (((*p) >> 6) & 0x03);
|
||||
*type = (Der_type) (((*p) >> 5) & 0x01);
|
||||
*tag = (*p) & 0x1F;
|
||||
if (size)
|
||||
|
|
@ -916,7 +916,7 @@ der_get_tag(const unsigned char *p, size_t len,
|
|||
|
||||
static int
|
||||
der_match_tag(const unsigned char *p, size_t len,
|
||||
Der_class class, Der_type type,
|
||||
Der_class xclass, Der_type type,
|
||||
int tag, size_t *size)
|
||||
{
|
||||
size_t l;
|
||||
|
|
@ -928,7 +928,7 @@ der_match_tag(const unsigned char *p, size_t len,
|
|||
e = der_get_tag(p, len, &thisclass, &thistype, &thistag, &l);
|
||||
if (e)
|
||||
return (e);
|
||||
if (class != thisclass || type != thistype)
|
||||
if (xclass != thisclass || type != thistype)
|
||||
return (ASN1_BAD_ID);
|
||||
if (tag > thistag)
|
||||
return (ASN1_MISPLACED_FIELD);
|
||||
|
|
@ -941,13 +941,13 @@ der_match_tag(const unsigned char *p, size_t len,
|
|||
|
||||
static int
|
||||
der_match_tag_and_length(const unsigned char *p, size_t len,
|
||||
Der_class class, Der_type type, int tag,
|
||||
Der_class xclass, Der_type type, int tag,
|
||||
size_t *length_ret, size_t *size)
|
||||
{
|
||||
size_t l, ret = 0;
|
||||
int e;
|
||||
|
||||
e = der_match_tag(p, len, class, type, tag, &l);
|
||||
e = der_match_tag(p, len, xclass, type, tag, &l);
|
||||
if (e)
|
||||
return (e);
|
||||
p += l;
|
||||
|
|
@ -1250,19 +1250,19 @@ der_put_oid(unsigned char *p, size_t len,
|
|||
}
|
||||
|
||||
static int
|
||||
der_put_tag(unsigned char *p, size_t len, Der_class class, Der_type type,
|
||||
der_put_tag(unsigned char *p, size_t len, Der_class xclass, Der_type type,
|
||||
int tag, size_t *size)
|
||||
{
|
||||
if (len < 1U)
|
||||
return (ASN1_OVERFLOW);
|
||||
*p = (class << 6) | (type << 5) | tag; /* XXX */
|
||||
*p = (xclass << 6) | (type << 5) | tag; /* XXX */
|
||||
*size = 1;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
der_put_length_and_tag(unsigned char *p, size_t len, size_t len_val,
|
||||
Der_class class, Der_type type, int tag, size_t *size)
|
||||
Der_class xclass, Der_type type, int tag, size_t *size)
|
||||
{
|
||||
size_t ret = 0;
|
||||
size_t l;
|
||||
|
|
@ -1274,7 +1274,7 @@ der_put_length_and_tag(unsigned char *p, size_t len, size_t len_val,
|
|||
p -= l;
|
||||
len -= l;
|
||||
ret += l;
|
||||
e = der_put_tag(p, len, class, type, tag, &l);
|
||||
e = der_put_tag(p, len, xclass, type, tag, &l);
|
||||
if (e)
|
||||
return (e);
|
||||
p -= l;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ t_main(int argc, char **argv);
|
|||
#endif
|
||||
|
||||
void
|
||||
t_assert(const char *component, int anum, int class, const char *what, ...)
|
||||
t_assert(const char *component, int anum, int tclass, const char *what, ...)
|
||||
ISC_FORMAT_PRINTF(4, 5);
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -359,11 +359,11 @@ t_main(int argc, char **argv)
|
|||
}
|
||||
|
||||
void
|
||||
t_assert(const char *component, int anum, int class, const char *what, ...) {
|
||||
t_assert(const char *component, int anum, int tclass, const char *what, ...) {
|
||||
va_list args;
|
||||
char buf[T_BIGBUF];
|
||||
|
||||
(void)printf("T:%s:%d:%s\n", component, anum, class == T_REQUIRED ?
|
||||
(void)printf("T:%s:%d:%s\n", component, anum, tclass == T_REQUIRED ?
|
||||
"A" : "C");
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue