]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove unused obsolete isc_hash_* function, and just keep the FNV-1a version
authorOndřej Surý <ondrej@sury.org>
Tue, 27 Mar 2018 14:23:13 +0000 (16:23 +0200)
committerOndřej Surý <ondrej@sury.org>
Wed, 4 Apr 2018 21:12:14 +0000 (23:12 +0200)
34 files changed:
bin/check/named-checkconf.c
bin/check/named-checkzone.c
bin/dnssec/dnssec-cds.c
bin/dnssec/dnssec-dsfromkey.c
bin/dnssec/dnssec-importkey.c
bin/dnssec/dnssec-revoke.c
bin/dnssec/dnssec-settime.c
bin/dnssec/dnssec-signzone.c
bin/dnssec/dnssec-verify.c
bin/named/main.c
bin/named/server.c
bin/nsupdate/nsupdate.c
bin/tests/makejournal.c
bin/tests/optional/adb_test.c
bin/tests/optional/byname_test.c
bin/tests/system/pipelined/pipequeries.c
bin/tests/system/tkey/keycreate.c
bin/tests/system/tkey/keydelete.c
bin/tools/mdig.c
contrib/sdb/ldap/zone2ldap.c
contrib/sdb/pgsql/zonetodb.c
contrib/sdb/sqlite/zone2sqlite.c
lib/dns/include/dns/name.h
lib/dns/lib.c
lib/dns/name.c
lib/dns/tests/db_test.c
lib/dns/tests/dnstest.c
lib/dns/win32/libdns.def.in
lib/isc/hash.c
lib/isc/include/isc/hash.h
lib/isc/tests/isctest.c
lib/isc/win32/libisc.def.exclude
lib/isc/win32/libisc.def.in
lib/ns/tests/nstest.c

index f914e3b6d6e9237ebc64e599f57cfde18fcb5857..9c57c482977cd8786651f2b315bef35fc6520a76 100644 (file)
@@ -656,9 +656,6 @@ main(int argc, char **argv) {
        RUNTIME_CHECK(setup_logging(mctx, stdout, &logc) == ISC_R_SUCCESS);
 
        RUNTIME_CHECK(isc_entropy_create(mctx, &ectx) == ISC_R_SUCCESS);
-       RUNTIME_CHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE)
-                     == ISC_R_SUCCESS);
-
        dns_result_register();
 
        RUNTIME_CHECK(cfg_parser_create(mctx, logc, &parser) == ISC_R_SUCCESS);
@@ -689,7 +686,6 @@ main(int argc, char **argv) {
 
        isc_log_destroy(&logc);
 
-       isc_hash_destroy();
        isc_entropy_detach(&ectx);
 
        isc_mem_destroy(&mctx);
index bfbe123729b65bb1be504cc38f6802c7e4372757..590948ebca2e011236ce250a59829919719850d6 100644 (file)
@@ -523,8 +523,6 @@ main(int argc, char **argv) {
                RUNTIME_CHECK(setup_logging(mctx, errout, &lctx)
                              == ISC_R_SUCCESS);
        RUNTIME_CHECK(isc_entropy_create(mctx, &ectx) == ISC_R_SUCCESS);
-       RUNTIME_CHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE)
-                     == ISC_R_SUCCESS);
 
        dns_result_register();
 
@@ -556,7 +554,6 @@ main(int argc, char **argv) {
        destroy();
        if (lctx != NULL)
                isc_log_destroy(&lctx);
-       isc_hash_destroy();
        isc_entropy_detach(&ectx);
        isc_mem_destroy(&mctx);
 #ifdef _WIN32
index 91d4b863a96d65f112352e44720ddbc85254a94e..4758c476d6f38289107d382e61557998f15fe4a5 100644 (file)
@@ -1234,10 +1234,6 @@ main(int argc, char *argv[]) {
        if (ectx == NULL) {
                setup_entropy(mctx, NULL, &ectx);
        }
-       result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
-       if (result != ISC_R_SUCCESS) {
-               fatal("could not initialize hash");
-       }
        result = dst_lib_init(mctx, ectx,
                              ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY);
        if (result != ISC_R_SUCCESS) {
@@ -1394,7 +1390,6 @@ main(int argc, char *argv[]) {
        free_all_sets();
        cleanup_logging(&lctx);
        dst_lib_destroy();
-       isc_hash_destroy();
        cleanup_entropy(&ectx);
        if (verbose > 10) {
                isc_mem_stats(mctx, stdout);
index a5bb03a0f9ceea8e5f9fbd41004cb4ef6b2ce57b..44968404b7b940d50d9555e87950b961cf28b1db 100644 (file)
@@ -484,9 +484,6 @@ main(int argc, char **argv) {
        if (result != ISC_R_SUCCESS)
                fatal("could not initialize dst: %s",
                      isc_result_totext(result));
-       result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
-       if (result != ISC_R_SUCCESS)
-               fatal("could not initialize hash");
        isc_entropy_stopcallbacksources(ectx);
 
        setup_logging(mctx, &log);
@@ -548,7 +545,6 @@ main(int argc, char **argv) {
        if (dns_rdataset_isassociated(&rdataset))
                dns_rdataset_disassociate(&rdataset);
        cleanup_logging(&log);
-       isc_hash_destroy();
        dst_lib_destroy();
        cleanup_entropy(&ectx);
        dns_name_destroy();
index 75ee872a375a3fe60314edd8781610386781d833..76c384eff59f6c78737cfbcacf13a963a0c79dfc 100644 (file)
@@ -413,9 +413,6 @@ main(int argc, char **argv) {
        if (result != ISC_R_SUCCESS)
                fatal("could not initialize dst: %s",
                      isc_result_totext(result));
-       result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
-       if (result != ISC_R_SUCCESS)
-               fatal("could not initialize hash");
        isc_entropy_stopcallbacksources(ectx);
 
        setup_logging(mctx, &log);
@@ -459,7 +456,6 @@ main(int argc, char **argv) {
        if (dns_rdataset_isassociated(&rdataset))
                dns_rdataset_disassociate(&rdataset);
        cleanup_logging(&log);
-       isc_hash_destroy();
        dst_lib_destroy();
        cleanup_entropy(&ectx);
        dns_name_destroy();
index 0b68e9940e78a9445640a753840270a155815a5d..1d7ae8f275041ebd64b26ebaa36a88d01a224646 100644 (file)
@@ -187,9 +187,6 @@ main(int argc, char **argv) {
        if (result != ISC_R_SUCCESS)
                fatal("Could not initialize dst: %s",
                      isc_result_totext(result));
-       result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
-       if (result != ISC_R_SUCCESS)
-               fatal("Could not initialize hash");
        isc_entropy_stopcallbacksources(ectx);
 
        result = dst_key_fromnamedfile(filename, dir,
@@ -271,7 +268,6 @@ main(int argc, char **argv) {
 
 cleanup:
        dst_key_free(&key);
-       isc_hash_destroy();
        dst_lib_destroy();
        cleanup_entropy(&ectx);
        if (verbose > 10)
index b7bf171855cb8038c8efa6d0e7b1345c954886fc..e82a08e5590a95d12922141259fe6068cc593afc 100644 (file)
@@ -385,9 +385,6 @@ main(int argc, char **argv) {
        if (result != ISC_R_SUCCESS)
                fatal("Could not initialize dst: %s",
                      isc_result_totext(result));
-       result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
-       if (result != ISC_R_SUCCESS)
-               fatal("Could not initialize hash");
        isc_entropy_stopcallbacksources(ectx);
 
        if (predecessor != NULL) {
@@ -672,7 +669,6 @@ main(int argc, char **argv) {
        if (prevkey != NULL)
                dst_key_free(&prevkey);
        dst_key_free(&key);
-       isc_hash_destroy();
        dst_lib_destroy();
        cleanup_entropy(&ectx);
        if (verbose > 10)
index 360ccef8940eea9cc880474101b4bd7f90294393..894752ae3389e03b638c1e3858ab4aee540985a4 100644 (file)
@@ -3508,10 +3508,6 @@ main(int argc, char *argv[]) {
                fatal("could not initialize dst: %s",
                      isc_result_totext(result));
 
-       result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
-       if (result != ISC_R_SUCCESS)
-               fatal("could not create hash context");
-
        isc_stdtime_get(&now);
 
        if (startstr != NULL) {
@@ -3925,7 +3921,6 @@ main(int argc, char *argv[]) {
        dns_master_styledestroy(&dsstyle, mctx);
 
        cleanup_logging(&log);
-       isc_hash_destroy();
        dst_lib_destroy();
        cleanup_entropy(&ectx);
        dns_name_destroy();
index d27dcae6a49bb70644fd1a5a9e32aa58598e810c..8e6dda2acfaebe66bc37175ca9344657486bf606 100644 (file)
@@ -286,10 +286,6 @@ main(int argc, char *argv[]) {
                fatal("could not initialize dst: %s",
                      isc_result_totext(result));
 
-       result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
-       if (result != ISC_R_SUCCESS)
-               fatal("could not create hash context");
-
        isc_stdtime_get(&now);
 
        rdclass = strtoclass(classname);
@@ -340,7 +336,6 @@ main(int argc, char *argv[]) {
 
        cleanup_logging(&log);
        dst_lib_destroy();
-       isc_hash_destroy();
        cleanup_entropy(&ectx);
        dns_name_destroy();
        if (verbose > 10)
index 7b66126bccb02f53b010dfb9f4a7104c12a995be..c19206215e625bce87e83a92855b7cfee26a2776 100644 (file)
@@ -852,15 +852,6 @@ create_managers(void) {
                return (ISC_R_UNEXPECTED);
        }
 
-       result = isc_hash_create(named_g_mctx, named_g_entropy,
-                                DNS_NAME_MAXWIRE);
-       if (result != ISC_R_SUCCESS) {
-               UNEXPECTED_ERROR(__FILE__, __LINE__,
-                                "isc_hash_create() failed: %s",
-                                isc_result_totext(result));
-               return (ISC_R_UNEXPECTED);
-       }
-
        return (ISC_R_SUCCESS);
 }
 
@@ -872,13 +863,6 @@ destroy_managers(void) {
        isc_taskmgr_destroy(&named_g_taskmgr);
        isc_timermgr_destroy(&named_g_timermgr);
        isc_socketmgr_destroy(&named_g_socketmgr);
-
-       /*
-        * isc_hash_destroy() cannot be called as long as a resolver may be
-        * running.  Calling this after isc_taskmgr_destroy() ensures the
-        * call is safe.
-        */
-       isc_hash_destroy();
 }
 
 static void
index ff4c8b66f7d64d92e4f4205367e90fb70a43259e..99f11bc92c4f54202a4b4955784ee0d45c0ceaff 100644 (file)
@@ -9247,8 +9247,6 @@ run_server(isc_task_t *task, isc_event_t *event) {
        CHECKFATAL(load_configuration(named_g_conffile, server, ISC_TRUE),
                   "loading configuration");
 
-       isc_hash_init();
-
        CHECKFATAL(load_zones(server, ISC_TRUE, ISC_FALSE), "loading zones");
 #ifdef ENABLE_AFL
        named_g_run_done = ISC_TRUE;
index 0243140b7d5195f53fac351171bce47d813c25c1..8d1176f6f194c1b50be5e642fb3dc96cc8944fcc 100644 (file)
@@ -971,9 +971,6 @@ setup_system(void) {
        if (entropy == NULL)
                setup_entropy(gmctx, NULL, &entropy);
 
-       result = isc_hash_create(gmctx, entropy, DNS_NAME_MAXWIRE);
-       check_result(result, "isc_hash_create");
-
        result = dns_dispatchmgr_create(gmctx, entropy, &dispatchmgr);
        check_result(result, "dns_dispatchmgr_create");
 
@@ -996,9 +993,6 @@ setup_system(void) {
        check_result(result, "dst_lib_init");
        is_dst_up = ISC_TRUE;
 
-       /* moved after dst_lib_init() */
-       isc_hash_init();
-
        attrmask = DNS_DISPATCHATTR_UDP | DNS_DISPATCHATTR_TCP;
        attrmask |= DNS_DISPATCHATTR_IPV4 | DNS_DISPATCHATTR_IPV6;
 
@@ -3305,9 +3299,6 @@ cleanup(void) {
        ddebug("Shutting down timer manager");
        isc_timermgr_destroy(&timermgr);
 
-       ddebug("Destroying hash context");
-       isc_hash_destroy();
-
        ddebug("Destroying name state");
        dns_name_destroy();
 
index a8af02bcae17f2cba581789db392a378bce0e68c..37c70a78a7943194ec36898cb528b4b6122eeaea 100644 (file)
@@ -40,7 +40,7 @@ isc_mem_t *mctx = NULL;
 isc_log_t *lctx = NULL;
 isc_entropy_t *ectx = NULL;
 
-static isc_boolean_t hash_active = ISC_FALSE, dst_active = ISC_FALSE;
+static isc_boolean_t dst_active = ISC_FALSE;
 
 /*
  * Logging categories: this needs to match the list in bin/named/log.c.
@@ -104,9 +104,6 @@ main(int argc, char **argv) {
        CHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_BLOCKING));
        dst_active = ISC_TRUE;
 
-       CHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE));
-       hash_active = ISC_TRUE;
-
        CHECK(isc_log_create(mctx, &lctx, &logconfig));
        isc_log_registercategories(lctx, categories);
        isc_log_setcontext(lctx);
@@ -153,10 +150,6 @@ main(int argc, char **argv) {
                dst_lib_destroy();
                dst_active = ISC_FALSE;
        }
-       if (hash_active) {
-               isc_hash_destroy();
-               hash_active = ISC_FALSE;
-       }
        if (ectx != NULL)
                isc_entropy_detach(&ectx);
        if (mctx != NULL)
index 9cd96a4a7a32ebb17e2499812bb66a87086fe0f4..efec3706d193f53a04abd8c5e57d46ca088dd66a 100644 (file)
@@ -306,9 +306,6 @@ main(int argc, char **argv) {
 
        result = isc_entropy_create(mctx, &ectx);
        check_result(result, "isc_entropy_create()");
-       result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
-       check_result(result, "isc_hash_create()");
-
        result = isc_log_create(mctx, &lctx, &lcfg);
        check_result(result, "isc_log_create()");
        isc_log_setcontext(lctx);
@@ -418,7 +415,6 @@ main(int argc, char **argv) {
 
        isc_log_destroy(&lctx);
 
-       isc_hash_destroy();
        isc_entropy_detach(&ectx);
 
        isc_mempool_destroy(&cmp);
index d4853c476009cfa612221d6c66875781c4c036bf..0990967043ae1ec0b2076833e7644d20610a57f4 100644 (file)
@@ -209,8 +209,6 @@ main(int argc, char *argv[]) {
        RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
 
        RUNTIME_CHECK(isc_entropy_create(mctx, &ectx) == ISC_R_SUCCESS);
-       RUNTIME_CHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE)
-                     == ISC_R_SUCCESS);
 
        while ((ch = isc_commandline_parse(argc, argv, "d:vw:")) != -1) {
                switch (ch) {
@@ -356,7 +354,6 @@ main(int argc, char *argv[]) {
 
        isc_log_destroy(&lctx);
 
-       isc_hash_destroy();
        isc_entropy_detach(&ectx);
 
        if (verbose)
index a9a3362a928387f23da723e7e284074a27921192..93455861efff3830f3c9a8fd51172782234be7cd 100644 (file)
@@ -285,7 +285,6 @@ main(int argc, char *argv[]) {
                RUNCHECK(isc_entropy_createfilesource(ectx, randomfile));
 
        RUNCHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_GOODONLY));
-       RUNCHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE));
 
        taskmgr = NULL;
        RUNCHECK(isc_taskmgr_create(mctx, 1, 0, &taskmgr));
@@ -338,7 +337,6 @@ main(int argc, char *argv[]) {
        isc_task_detach(&task);
        isc_taskmgr_destroy(&taskmgr);
 
-       isc_hash_destroy();
        dst_lib_destroy();
        isc_entropy_detach(&ectx);
 
index 8149269c61dad8d183854c7ca807976b21dcf3ea..ea41bc3bdf5402ca7634004643eca76f02a37706 100644 (file)
@@ -265,7 +265,6 @@ main(int argc, char *argv[]) {
        RUNCHECK(isc_log_create(mctx, &log, &logconfig));
 
        RUNCHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_GOODONLY));
-       RUNCHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE));
 
        taskmgr = NULL;
        RUNCHECK(isc_taskmgr_create(mctx, 1, 0, &taskmgr));
@@ -344,7 +343,6 @@ main(int argc, char *argv[]) {
 
        isc_log_destroy(&log);
 
-       isc_hash_destroy();
        dst_lib_destroy();
        isc_entropy_detach(&ectx);
 
index 376d31d0276d1127aee766b31717985e75d0c9c5..931e77f4969a0853376b254fe3279be89ddac143 100644 (file)
@@ -196,7 +196,6 @@ main(int argc, char **argv) {
        RUNCHECK(isc_log_create(mctx, &log, &logconfig));
 
        RUNCHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_GOODONLY));
-       RUNCHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE));
 
        taskmgr = NULL;
        RUNCHECK(isc_taskmgr_create(mctx, 1, 0, &taskmgr));
@@ -279,7 +278,6 @@ main(int argc, char **argv) {
 
        isc_log_destroy(&log);
 
-       isc_hash_destroy();
        dst_lib_destroy();
        isc_entropy_detach(&ectx);
 
index 7c8c3be29b103a319aed595d722fec4c7525057f..e590e3aa6ef316a1dbf8809efe40039dfa8a9b63 100644 (file)
@@ -1935,7 +1935,6 @@ main(int argc, char *argv[]) {
        ectx = NULL;
        RUNCHECK(isc_entropy_create(mctx, &ectx));
        RUNCHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_GOODONLY));
-       RUNCHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE));
        RUNCHECK(isc_entropy_getdata(ectx, cookie_secret,
                                     sizeof(cookie_secret), NULL, 0));
 
@@ -2037,7 +2036,6 @@ main(int argc, char *argv[]) {
        isc_taskmgr_destroy(&taskmgr);
 
        dst_lib_destroy();
-       isc_hash_destroy();
        isc_entropy_detach(&ectx);
 
        isc_log_destroy(&lctx);
index ed674b57d2a4e2609eb6d9c9735552a3540b59f2..3f5030307da923ac27fc36583122ca4a467ef61a 100644 (file)
@@ -217,9 +217,6 @@ main (int argc, char **argv)
   result = isc_entropy_create(mctx, &ectx);
   isc_result_check (result, "isc_entropy_create");
 
-  result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
-  isc_result_check (result, "isc_hash_create");
-
   isc_buffer_init (&buff, argzone, strlen (argzone));
   isc_buffer_add (&buff, strlen (argzone));
   dns_fixedname_init (&fixedzone);
@@ -348,7 +345,6 @@ main (int argc, char **argv)
        printf("Operation Complete.\n");
 
   /* Cleanup */
-  isc_hash_destroy();
   isc_entropy_detach(&ectx);
   isc_mem_destroy(&mctx);
   if (zonefile)
index 81eb35bd8f2bbed17cc8ab25e575e4a13471a4ef..dc63c5b540c97072a7d946b6cb1e5048642a9e7c 100644 (file)
@@ -161,9 +161,6 @@ main(int argc, char **argv) {
        result = isc_entropy_create(mctx, &ectx);
        check_result(result, "isc_entropy_create");
 
-       result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
-       check_result(result, "isc_hash_create");
-
        isc_buffer_init(&b, porigin, strlen(porigin));
        isc_buffer_add(&b, strlen(porigin));
        dns_fixedname_init(&forigin);
@@ -278,7 +275,6 @@ main(int argc, char **argv) {
        PQclear(res);
        dns_dbiterator_destroy(&dbiter);
        dns_db_detach(&db);
-       isc_hash_destroy();
        isc_entropy_detach(&ectx);
        isc_mem_destroy(&mctx);
        closeandexit(0);
index b2d09b4a22e2b4bf6b3f76307762c9d919b05d9f..88a2d014694625af871ce3795c9aa9c2cf1c535f 100644 (file)
@@ -169,8 +169,6 @@ main(int argc, char *argv[])
     check_result(result, "isc_mem_create");
     result = isc_entropy_create(mctx, &ectx);
     check_result(result, "isc_entropy_create");
-    result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
-    check_result(result, "isc_hash_create");
     
     isc_buffer_init(&b, porigin, strlen(porigin));
     isc_buffer_add(&b, strlen(porigin));
@@ -288,7 +286,6 @@ main(int argc, char *argv[])
     
     dns_dbiterator_destroy(&dbiter);
     dns_db_detach(&db);
-    isc_hash_destroy();
     isc_entropy_detach(&ectx);
     isc_mem_destroy(&mctx);
 
index 0e8df13a124b7a75fed0e74f49076b50846b4729..06235e8ff6f33c257105391bae5d9b371068dc2f 100644 (file)
@@ -372,26 +372,6 @@ dns_name_fullhash(const dns_name_t *name, isc_boolean_t case_sensitive);
  *\li  A hash value
  */
 
-unsigned int
-dns_name_hashbylabel(const dns_name_t *name, isc_boolean_t case_sensitive);
-/*%<
- * Provide a hash value for 'name', where the hash value is the sum
- * of the hash values of each label.  This function should only be used
- * when incremental hashing is necessary, for example, during RBT
- * traversal. It is not currently used in BIND. Generally,
- * dns_name_fullhash() is the correct function to use for name
- * hashing.
- *
- * Note: if 'case_sensitive' is ISC_FALSE, then names which differ only in
- * case will have the same hash value.
- *
- * Requires:
- *\li  'name' is a valid name
- *
- * Returns:
- *\li  A hash value
- */
-
 /*
  *** Comparisons
  ***/
index c6d83e948912f88064ecdfea3c91e7bc698344a2..20aabc9a80f60ea780b96e50cc11910b29b3c482 100644 (file)
@@ -90,19 +90,15 @@ initialize(void) {
        result = isc_entropy_create(dns_g_mctx, &ectx);
        if (result != ISC_R_SUCCESS)
                goto cleanup_db;
-       result = isc_hash_create(dns_g_mctx, NULL, DNS_NAME_MAXWIRE);
-       if (result != ISC_R_SUCCESS)
-               goto cleanup_ectx;
 
        result = dst_lib_init(dns_g_mctx, ectx, 0);
        if (result != ISC_R_SUCCESS)
-               goto cleanup_hash;
+               goto cleanup_ectx;
 
        result = isc_mutex_init(&reflock);
        if (result != ISC_R_SUCCESS)
                goto cleanup_dst;
 
-       isc_hash_init();
        isc_entropy_detach(&ectx);
 
        initialize_done = ISC_TRUE;
@@ -113,8 +109,6 @@ initialize(void) {
   cleanup_ectx:
        if (ectx != NULL)
                isc_entropy_detach(&ectx);
-  cleanup_hash:
-       isc_hash_destroy();
   cleanup_db:
        if (dbimp != NULL)
                dns_ecdb_unregister(&dbimp);
@@ -160,8 +154,6 @@ dns_lib_shutdown(void) {
 
        dst_lib_destroy();
 
-       if (isc_hashctx != NULL)
-               isc_hash_destroy();
        if (dbimp != NULL)
                dns_ecdb_unregister(&dbimp);
        if (dns_g_mctx != NULL)
index 09c1a2991b7a88ed861ce337016b075a60a53653..7d7623b1b0b071d1f54f2accd5d7c21100f087b9 100644 (file)
@@ -161,9 +161,6 @@ static dns_name_t const wild =
 
 LIBDNS_EXTERNAL_DATA const dns_name_t *dns_wildcardname = &wild;
 
-unsigned int
-dns_fullname_hash(const dns_name_t *name, isc_boolean_t case_sensitive);
-
 /*
  * dns_name_t to text post-conversion procedure.
  */
@@ -489,52 +486,6 @@ dns_name_fullhash(const dns_name_t *name, isc_boolean_t case_sensitive) {
                                          case_sensitive, NULL));
 }
 
-unsigned int
-dns_fullname_hash(const dns_name_t *name, isc_boolean_t case_sensitive) {
-       /*
-        * This function was deprecated due to the breakage of the name space
-        * convention.  We only keep this internally to provide binary backward
-        * compatibility.
-        */
-       return (dns_name_fullhash(name, case_sensitive));
-}
-
-unsigned int
-dns_name_hashbylabel(const dns_name_t *name, isc_boolean_t case_sensitive) {
-       unsigned char *offsets;
-       dns_offsets_t odata;
-       dns_name_t tname;
-       unsigned int h = 0;
-       unsigned int i;
-
-       /*
-        * Provide a hash value for 'name'.
-        */
-       REQUIRE(VALID_NAME(name));
-
-       if (name->labels == 0)
-               return (0);
-       else if (name->labels == 1)
-               return (isc_hash_function_reverse(name->ndata, name->length,
-                                                 case_sensitive, NULL));
-
-       SETUP_OFFSETS(name, offsets, odata);
-       DNS_NAME_INIT(&tname, NULL);
-       tname.labels = 1;
-       h = 0;
-       for (i = 0; i < name->labels; i++) {
-               tname.ndata = name->ndata + offsets[i];
-               if (i == name->labels - 1)
-                       tname.length = name->length - offsets[i];
-               else
-                       tname.length = offsets[i + 1] - offsets[i];
-               h += isc_hash_function_reverse(tname.ndata, tname.length,
-                                              case_sensitive, NULL);
-       }
-
-       return (h);
-}
-
 dns_namereln_t
 dns_name_fullcompare(const dns_name_t *name1, const dns_name_t *name2,
                     int *orderp, unsigned int *nlabelsp)
index 96456e6cffe58a2ae74adcc3947c1db430c730d9..f002a13962d354e06d1cc7bea93cec48aae95abb 100644 (file)
@@ -52,9 +52,6 @@ ATF_TC_BODY(getoriginnode, tc) {
        result = isc_mem_create(0, 0, &mymctx);
        ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
 
-       result = isc_hash_create(mymctx, NULL, 256);
-       ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
-
        result = dns_db_create(mymctx, "rbt", dns_rootname, dns_dbtype_zone,
                               dns_rdataclass_in, 0, NULL, &db);
        ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
@@ -85,9 +82,6 @@ ATF_TC_BODY(getsetservestalettl, tc) {
        result = isc_mem_create(0, 0, &mymctx);
        ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
 
-       result = isc_hash_create(mymctx, NULL, 256);
-       ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
-
        result = dns_db_create(mymctx, "rbt", dns_rootname, dns_dbtype_cache,
                               dns_rdataclass_in, 0, NULL, &db);
        ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
@@ -133,9 +127,6 @@ ATF_TC_BODY(dns_dbfind_staleok, tc) {
        result = isc_mem_create(0, 0, &mymctx);
        ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
 
-       result = isc_hash_create(mymctx, NULL, 256);
-       ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
-
        result = dns_db_create(mymctx, "rbt", dns_rootname, dns_dbtype_cache,
                               dns_rdataclass_in, 0, NULL, &db);
        ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
index e9ccf8dfa8c3e5e26d16bc0cb8b9c73a26ae11c9..1a546fa802cdde0444c72d2be0dcf61c611993a6 100644 (file)
@@ -58,7 +58,7 @@ isc_boolean_t app_running = ISC_FALSE;
 int ncpus;
 isc_boolean_t debug_mem_record = ISC_TRUE;
 
-static isc_boolean_t hash_active = ISC_FALSE, dst_active = ISC_FALSE;
+static isc_boolean_t dst_active = ISC_FALSE;
 
 /*
  * Logging categories: this needs to match the list in bin/named/log.c.
@@ -123,9 +123,6 @@ dns_test_begin(FILE *logfile, isc_boolean_t start_managers) {
        CHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_BLOCKING));
        dst_active = ISC_TRUE;
 
-       CHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE));
-       hash_active = ISC_TRUE;
-
        if (logfile != NULL) {
                isc_logdestination_t destination;
                isc_logconfig_t *logconfig = NULL;
@@ -169,10 +166,6 @@ dns_test_begin(FILE *logfile, isc_boolean_t start_managers) {
 
 void
 dns_test_end(void) {
-       if (hash_active) {
-               isc_hash_destroy();
-               hash_active = ISC_FALSE;
-       }
        if (dst_active) {
                dst_lib_destroy();
                dst_active = ISC_FALSE;
index 14375088a04180b0964da3b724c8a0e7e5428949..fc7ab3eae03d9ce629a22a64afa152c1395e3eb3 100644 (file)
@@ -594,7 +594,6 @@ dns_name_getlabel
 dns_name_getlabelsequence
 dns_name_hasbuffer
 dns_name_hash
-dns_name_hashbylabel
 dns_name_init
 dns_name_internalwildcard
 dns_name_invalidate
index 593c8e967122a3a1ddd05a56328f5211d058aade..cfa9a3bec4f57138be7f7b84870e1be58acc6bd3 100644 (file)
@@ -9,47 +9,7 @@
  * information regarding copyright ownership.
  */
 
-/*! \file
- * Some portion of this code was derived from universal hash function
- * libraries of Rice University.
-\section license UH Universal Hashing Library
-
-Copyright ((c)) 2002, Rice University
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-    * Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-
-    * Redistributions in binary form must reproduce the above
-    copyright notice, this list of conditions and the following
-    disclaimer in the documentation and/or other materials provided
-    with the distribution.
-
-    * Neither the name of Rice University (RICE) nor the names of its
-    contributors may be used to endorse or promote products derived
-    from this software without specific prior written permission.
-
-
-This software is provided by RICE and the contributors on an "as is"
-basis, without any representations or warranties of any kind, express
-or implied including, but not limited to, representations or
-warranties of non-infringement, merchantability or fitness for a
-particular purpose. In no event shall RICE or contributors be liable
-for any direct, indirect, incidental, special, exemplary, or
-consequential damages (including, but not limited to, procurement of
-substitute goods or services; loss of use, data, or profits; or
-business interruption) however caused and on any theory of liability,
-whether in contract, strict liability, or tort (including negligence
-or otherwise) arising in any way out of the use of this software, even
-if advised of the possibility of such damage.
-*/
-
 #include <config.h>
-
 #include <isc/entropy.h>
 #include <isc/hash.h>
 #include <isc/mem.h>
@@ -61,40 +21,9 @@ if advised of the possibility of such damage.
 #include <isc/string.h>
 #include <isc/util.h>
 
-#define HASH_MAGIC             ISC_MAGIC('H', 'a', 's', 'h')
-#define VALID_HASH(h)          ISC_MAGIC_VALID((h), HASH_MAGIC)
-
-/*%
- * A large 32-bit prime number that specifies the range of the hash output.
- */
-#define PRIME32 0xFFFFFFFB              /* 2^32 -  5 */
-
-/*@{*/
-/*%
- * Types of random seed and hash accumulator.  Perhaps they can be system
- * dependent.
- */
-typedef isc_uint32_t hash_accum_t;
-typedef isc_uint16_t hash_random_t;
-/*@}*/
-
-/*% isc hash structure */
-struct isc_hash {
-       unsigned int    magic;
-       isc_mem_t       *mctx;
-       isc_mutex_t     lock;
-       isc_boolean_t   initialized;
-       isc_refcount_t  refcnt;
-       isc_entropy_t   *entropy; /*%< entropy source */
-       size_t          limit;  /*%< upper limit of key length */
-       size_t          vectorlen; /*%< size of the vector below */
-       hash_random_t   *rndvector; /*%< random vector for universal hashing */
-};
-
-static isc_mutex_t createlock;
-static isc_once_t once = ISC_ONCE_INIT;
-
-LIBISC_EXTERNAL_DATA isc_hash_t *isc_hashctx = NULL;
+static isc_uint32_t fnv_offset_basis;
+static isc_once_t fnv_once = ISC_ONCE_INIT;
+static isc_boolean_t fnv_initialized = ISC_FALSE;
 
 static unsigned char maptolower[] = {
        0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
@@ -131,277 +60,6 @@ static unsigned char maptolower[] = {
        0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
 };
 
-isc_result_t
-isc_hash_ctxcreate(isc_mem_t *mctx, isc_entropy_t *entropy,
-                  size_t limit, isc_hash_t **hctxp)
-{
-       isc_result_t result;
-       isc_hash_t *hctx;
-       size_t vlen;
-       hash_random_t *rv;
-       hash_accum_t overflow_limit;
-
-       REQUIRE(mctx != NULL);
-       REQUIRE(hctxp != NULL && *hctxp == NULL);
-
-       /*
-        * Overflow check.  Since our implementation only does a modulo
-        * operation at the last stage of hash calculation, the accumulator
-        * must not overflow.
-        */
-       overflow_limit =
-               1 << (((sizeof(hash_accum_t) - sizeof(hash_random_t))) * 8);
-       if (overflow_limit < (limit + 1) * 0xff)
-               return (ISC_R_RANGE);
-
-       hctx = isc_mem_get(mctx, sizeof(isc_hash_t));
-       if (hctx == NULL)
-               return (ISC_R_NOMEMORY);
-
-       vlen = sizeof(hash_random_t) * (limit + 1);
-       rv = isc_mem_get(mctx, vlen);
-       if (rv == NULL) {
-               result = ISC_R_NOMEMORY;
-               goto errout;
-       }
-
-       /*
-        * We need a lock.
-        */
-       result = isc_mutex_init(&hctx->lock);
-       if (result != ISC_R_SUCCESS)
-               goto errout;
-
-       /*
-        * From here down, no failures will/can occur.
-        */
-       hctx->magic = HASH_MAGIC;
-       hctx->mctx = NULL;
-       isc_mem_attach(mctx, &hctx->mctx);
-       hctx->initialized = ISC_FALSE;
-       result = isc_refcount_init(&hctx->refcnt, 1);
-       if (result != ISC_R_SUCCESS)
-               goto cleanup_lock;
-       hctx->entropy = NULL;
-       hctx->limit = limit;
-       hctx->vectorlen = vlen;
-       hctx->rndvector = rv;
-
-       if (entropy != NULL)
-               isc_entropy_attach(entropy, &hctx->entropy);
-
-       *hctxp = hctx;
-       return (ISC_R_SUCCESS);
-
- cleanup_lock:
-       DESTROYLOCK(&hctx->lock);
- errout:
-       isc_mem_put(mctx, hctx, sizeof(isc_hash_t));
-       if (rv != NULL)
-               isc_mem_put(mctx, rv, vlen);
-
-       return (result);
-}
-
-static void
-initialize_lock(void) {
-       RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS);
-}
-
-isc_result_t
-isc_hash_create(isc_mem_t *mctx, isc_entropy_t *entropy, size_t limit) {
-       isc_result_t result = ISC_R_SUCCESS;
-
-       REQUIRE(mctx != NULL);
-       INSIST(isc_hashctx == NULL);
-
-       RUNTIME_CHECK(isc_once_do(&once, initialize_lock) == ISC_R_SUCCESS);
-
-       LOCK(&createlock);
-
-       if (isc_hashctx == NULL)
-               result = isc_hash_ctxcreate(mctx, entropy, limit,
-                                           &isc_hashctx);
-
-       UNLOCK(&createlock);
-
-       return (result);
-}
-
-void
-isc_hash_ctxinit(isc_hash_t *hctx) {
-       LOCK(&hctx->lock);
-
-       if (hctx->initialized == ISC_TRUE)
-               goto out;
-
-       if (hctx->entropy != NULL) {
-               isc_result_t result;
-
-               result = isc_entropy_getdata(hctx->entropy,
-                                            hctx->rndvector,
-                                            (unsigned int)hctx->vectorlen,
-                                            NULL, 0);
-               INSIST(result == ISC_R_SUCCESS);
-       } else {
-               isc_uint32_t pr;
-               size_t i, copylen;
-               unsigned char *p;
-
-               p = (unsigned char *)hctx->rndvector;
-               for (i = 0; i < hctx->vectorlen; i += copylen, p += copylen) {
-                       isc_random_get(&pr);
-                       if (i + sizeof(pr) <= hctx->vectorlen)
-                               copylen = sizeof(pr);
-                       else
-                               copylen = hctx->vectorlen - i;
-
-                       memmove(p, &pr, copylen);
-               }
-               INSIST(p == (unsigned char *)hctx->rndvector +
-                      hctx->vectorlen);
-       }
-
-       hctx->initialized = ISC_TRUE;
-
- out:
-       UNLOCK(&hctx->lock);
-}
-
-void
-isc_hash_init(void) {
-       INSIST(isc_hashctx != NULL && VALID_HASH(isc_hashctx));
-
-       isc_hash_ctxinit(isc_hashctx);
-}
-
-void
-isc_hash_ctxattach(isc_hash_t *hctx, isc_hash_t **hctxp) {
-       REQUIRE(VALID_HASH(hctx));
-       REQUIRE(hctxp != NULL && *hctxp == NULL);
-
-       isc_refcount_increment(&hctx->refcnt, NULL);
-       *hctxp = hctx;
-}
-
-static void
-destroy(isc_hash_t **hctxp) {
-       isc_hash_t *hctx;
-       isc_mem_t *mctx;
-
-       REQUIRE(hctxp != NULL && *hctxp != NULL);
-       hctx = *hctxp;
-       *hctxp = NULL;
-
-       LOCK(&hctx->lock);
-
-       isc_refcount_destroy(&hctx->refcnt);
-
-       mctx = hctx->mctx;
-       if (hctx->entropy != NULL)
-               isc_entropy_detach(&hctx->entropy);
-       if (hctx->rndvector != NULL)
-               isc_mem_put(mctx, hctx->rndvector, hctx->vectorlen);
-
-       UNLOCK(&hctx->lock);
-
-       DESTROYLOCK(&hctx->lock);
-
-       memset(hctx, 0, sizeof(isc_hash_t));
-       isc_mem_put(mctx, hctx, sizeof(isc_hash_t));
-       isc_mem_detach(&mctx);
-}
-
-void
-isc_hash_ctxdetach(isc_hash_t **hctxp) {
-       isc_hash_t *hctx;
-       unsigned int refs;
-
-       REQUIRE(hctxp != NULL && VALID_HASH(*hctxp));
-       hctx = *hctxp;
-
-       isc_refcount_decrement(&hctx->refcnt, &refs);
-       if (refs == 0)
-               destroy(&hctx);
-
-       *hctxp = NULL;
-}
-
-void
-isc_hash_destroy(void) {
-       unsigned int refs;
-
-       INSIST(isc_hashctx != NULL && VALID_HASH(isc_hashctx));
-
-       isc_refcount_decrement(&isc_hashctx->refcnt, &refs);
-       INSIST(refs == 0);
-
-       destroy(&isc_hashctx);
-}
-
-static inline unsigned int
-hash_calc(isc_hash_t *hctx, const unsigned char *key, unsigned int keylen,
-         isc_boolean_t case_sensitive)
-{
-       hash_accum_t partial_sum = 0;
-       hash_random_t *p = hctx->rndvector;
-       unsigned int i = 0;
-
-       /* Make it sure that the hash context is initialized. */
-       if (hctx->initialized == ISC_FALSE)
-               isc_hash_ctxinit(hctx);
-
-       if (case_sensitive) {
-               for (i = 0; i < keylen; i++)
-                       partial_sum += key[i] * (hash_accum_t)p[i];
-       } else {
-               for (i = 0; i < keylen; i++)
-                       partial_sum += maptolower[key[i]] * (hash_accum_t)p[i];
-       }
-
-       partial_sum += p[i];
-
-       return ((unsigned int)(partial_sum % PRIME32));
-}
-
-unsigned int
-isc_hash_ctxcalc(isc_hash_t *hctx, const unsigned char *key,
-                unsigned int keylen, isc_boolean_t case_sensitive)
-{
-       REQUIRE(hctx != NULL && VALID_HASH(hctx));
-       REQUIRE(keylen <= hctx->limit);
-
-       return (hash_calc(hctx, key, keylen, case_sensitive));
-}
-
-unsigned int
-isc_hash_calc(const unsigned char *key, unsigned int keylen,
-             isc_boolean_t case_sensitive)
-{
-       INSIST(isc_hashctx != NULL && VALID_HASH(isc_hashctx));
-       REQUIRE(keylen <= isc_hashctx->limit);
-
-       return (hash_calc(isc_hashctx, key, keylen, case_sensitive));
-}
-
-void
-isc__hash_setvec(const isc_uint16_t *vec) {
-       int i;
-       hash_random_t *p;
-
-       if (isc_hashctx == NULL)
-               return;
-
-       p = isc_hashctx->rndvector;
-       for (i = 0; i < 256; i++) {
-               p[i] = vec[i];
-       }
-}
-
-static isc_uint32_t fnv_offset_basis;
-static isc_once_t fnv_once = ISC_ONCE_INIT;
-static isc_boolean_t fnv_initialized = ISC_FALSE;
-
 static void
 fnv_initialize(void) {
        /*
index e78a2155ab50851606913e26fc492b2f0dad63e3..d6b771ffca7c77cc2e8d833fb6601884194fe948 100644 (file)
 #ifndef ISC_HASH_H
 #define ISC_HASH_H 1
 
-#include <isc/deprecated.h>
-#include <isc/types.h>
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/hash.h
- *
- * \brief The hash API
- *     provides an unpredictable hash value for variable length data.
- *     A hash object contains a random vector (which is hidden from clients
- *     of this API) to make the actual hash value unpredictable.
- *
- *     The algorithm used in the API guarantees the probability of hash
- *     collision; in the current implementation, as long as the values stored
- *     in the random vector are unpredictable, the probability of hash
- *     collision between arbitrary two different values is at most 1/2^16.
- *
- *     Although the API is generic about the hash keys, it mainly expects
- *     DNS names (and sometimes IPv4/v6 addresses) as inputs.  It has an
- *     upper limit of the input length, and may run slow to calculate the
- *     hash values for large inputs.
- *
- *     This API is designed to be general so that it can provide multiple
- *     different hash contexts that have different random vectors.  However,
- *     it should be typical to have a single context for an entire system.
- *     To support such cases, the API also provides a single-context mode.
- *
- * \li MP:
- *     The hash object is almost read-only.  Once the internal random vector
- *     is initialized, no write operation will occur, and there will be no
- *     need to lock the object to calculate actual hash values.
- *
- * \li Reliability:
- *     In some cases this module uses low-level data copy to initialize the
- *     random vector.  Errors in this part are likely to crash the server or
- *     corrupt memory.
- *
- * \li Resources:
- *     A buffer, used as a random vector for calculating hash values.
- *
- * \li Security:
- *     This module intends to provide unpredictable hash values in
- *     adversarial environments in order to avoid denial of service attacks
- *     to hash buckets.
- *     Its unpredictability relies on the quality of entropy to build the
- *     random vector.
- *
- * \li Standards:
- *     None.
- */
-
-/***
- *** Imports
- ***/
-
 #include <isc/types.h>
 
 /***
  ***/
 ISC_LANG_BEGINDECLS
 
-LIBISC_EXTERNAL_DATA extern isc_hash_t *isc_hashctx;
-
-isc_result_t
-isc_hash_ctxcreate(isc_mem_t *mctx, isc_entropy_t *entropy, size_t limit,
-                  isc_hash_t **hctx);
-isc_result_t
-isc_hash_create(isc_mem_t *mctx, isc_entropy_t *entropy, size_t limit);
-/*!<
- * \brief Create a new hash object.
- *
- * isc_hash_ctxcreate() creates a different object.
- *
- * isc_hash_create() creates a module-internal object to support the
- * single-context mode.  It should be called only once.
- *
- * 'entropy' must be NULL or a valid entropy object.  If 'entropy' is NULL,
- * pseudo random values will be used to build the random vector, which may
- * weaken security.
- *
- * 'limit' specifies the maximum number of hash keys.  If it is too large,
- * these functions may fail.
- */
-
-void
-isc_hash_ctxattach(isc_hash_t *hctx, isc_hash_t **hctxp)
-       ISC_DEPRECATED;
-/*!<
- * \brief Attach to a hash object.
- *
- * This function is only necessary for the multiple-context mode.
- */
-
-void
-isc_hash_ctxdetach(isc_hash_t **hctxp)
-       ISC_DEPRECATED;
-/*!<
- * \brief Detach from a hash object.
- *
- * This function  is for the multiple-context mode, and takes a valid
- * hash object as an argument.
- */
-
-void
-isc_hash_destroy(void);
-/*!<
- * \brief This function is for the single-context mode, and is expected to be used
- * as a counterpart of isc_hash_create().
- *
- * A valid module-internal hash object must have been created, and this
- * function should be called only once.
- */
-
-/*@{*/
-void
-isc_hash_ctxinit(isc_hash_t *hctx);
-void
-isc_hash_init(void);
-/*!<
- * \brief Initialize a hash object.
- *
- * It fills in the random vector with a proper
- * source of entropy, which is typically from the entropy object specified
- * at the creation.  Thus, it is desirable to call these functions after
- * initializing the entropy object with some good entropy sources.
- *
- * These functions should be called before the first hash calculation.
- *
- * isc_hash_ctxinit() is for the multiple-context mode, and takes a valid hash
- * object as an argument.
- *
- * isc_hash_init() is for the single-context mode.  A valid module-internal
- * hash object must have been created, and this function should be called only
- * once.
- */
-/*@}*/
-
-/*@{*/
-unsigned int
-isc_hash_ctxcalc(isc_hash_t *hctx, const unsigned char *key,
-                unsigned int keylen, isc_boolean_t case_sensitive)
-       ISC_DEPRECATED;
-unsigned int
-isc_hash_calc(const unsigned char *key, unsigned int keylen,
-             isc_boolean_t case_sensitive)
-       ISC_DEPRECATED;
-/*!<
- * \brief Calculate a hash value.
- *
- * isc_hash_ctxinit() is for the multiple-context mode, and takes a valid hash
- * object as an argument.
- *
- * isc_hash_init() is for the single-context mode.  A valid module-internal
- * hash object must have been created.
- *
- * 'key' is the hash key, which is a variable length buffer.
- *
- * 'keylen' specifies the key length, which must not be larger than the limit
- * specified for the corresponding hash object.
- *
- * 'case_sensitive' specifies whether the hash key should be treated as
- * case_sensitive values.  It should typically be ISC_FALSE if the hash key
- * is a DNS name.
- */
-/*@}*/
-
-void
-isc__hash_setvec(const isc_uint16_t *vec)
-       ISC_DEPRECATED;
-
-/*!<
- * \brief Set the contents of the random vector used in hashing.
- *
- * WARNING: This function is meant to be used only in testing code. It
- * must not be used anywhere in normally running code.
- *
- * The hash context must have been created beforehand, otherwise this
- * function is a nop.
- *
- * 'vec' is not documented here on purpose. You should know what you are
- * doing before using this function.
- */
-
 const void *
 isc_hash_get_initializer(void);
 
@@ -227,9 +48,6 @@ isc_hash_function_reverse(const void *data, size_t length,
  * useful in incremental hashing; for example, a previously hashed
  * value for 'com' can be used as input when hashing 'example.com'.
  *
- * This is a new variant of isc_hash_calc() and will supercede
- * isc_hash_calc() eventually.
- *
  * 'data' is the data to be hashed.
  *
  * 'length' is the size of the data to be hashed.
index bb1a6245b224cc45327c6d61e72810b1ff594177..9e83de34c9abad8845d5ef49740d494fb3971d58 100644 (file)
@@ -39,8 +39,6 @@ isc_socketmgr_t *socketmgr = NULL;
 isc_task_t *maintask = NULL;
 int ncpus;
 
-static isc_boolean_t hash_active = ISC_FALSE;
-
 /*
  * Logging categories: this needs to match the list in bin/named/log.c.
  */
@@ -109,9 +107,6 @@ isc_test_begin(FILE *logfile, isc_boolean_t start_managers,
        CHECK(isc_mem_create(0, 0, &mctx));
        CHECK(isc_entropy_create(mctx, &ectx));
 
-       CHECK(isc_hash_create(mctx, ectx, 255));
-       hash_active = ISC_TRUE;
-
        if (logfile != NULL) {
                isc_logdestination_t destination;
                isc_logconfig_t *logconfig = NULL;
@@ -154,10 +149,6 @@ isc_test_end(void) {
                isc_task_detach(&maintask);
        if (taskmgr != NULL)
                isc_taskmgr_destroy(&taskmgr);
-       if (hash_active) {
-               isc_hash_destroy();
-               hash_active = ISC_FALSE;
-       }
        if (ectx != NULL)
                isc_entropy_detach(&ectx);
 
index e1ffed8ebf1daef6ed4153ae8c80a42bb81a9e36..d2fe4eccbbf5c8e8d2c4eb9e1e1d5c1f2a86ac75 100644 (file)
@@ -1,6 +1,5 @@
 ; These symbols are not needed by the WIN32 build, but build-tarballs
 ; will complain if they aren't present here.
-isc__hash_setvec
 isc_socket_accept
 isc_socket_attach
 isc_socket_bind
index 074283a30c087d0b22e2c0c27c5f73412e665239..66a44a54bee5a2b98577ea3505f6174f7ea908ec 100644 (file)
@@ -51,7 +51,6 @@ isc__buffer_remainingregion
 isc__buffer_setactive
 isc__buffer_subtract
 isc__buffer_usedregion
-isc__hash_setvec
 isc__mem_allocate
 isc__mem_free
 isc__mem_get
@@ -262,18 +261,9 @@ isc_fsaccess_add
 isc_fsaccess_changeowner
 isc_fsaccess_remove
 isc_fsaccess_set
-isc_hash_calc
-isc_hash_create
-isc_hash_ctxattach
-isc_hash_ctxcalc
-isc_hash_ctxcreate
-isc_hash_ctxdetach
-isc_hash_ctxinit
-isc_hash_destroy
 isc_hash_function
 isc_hash_function_reverse
 isc_hash_get_initializer
-isc_hash_init
 isc_hash_set_initializer
 isc_heap_create
 isc_heap_decreased
index 79d5f270955e271616d1b2632d7e705d465bd5d0..620636d8f5b6ee4044625d0fb70adefbca1cdcb8 100644 (file)
@@ -68,7 +68,7 @@ int ncpus;
 isc_boolean_t debug_mem_record = ISC_TRUE;
 isc_boolean_t run_managers = ISC_FALSE;
 
-static isc_boolean_t hash_active = ISC_FALSE, dst_active = ISC_FALSE;
+static isc_boolean_t dst_active = ISC_FALSE;
 
 static dns_zone_t *served_zone = NULL;
 
@@ -248,9 +248,6 @@ ns_test_begin(FILE *logfile, isc_boolean_t start_managers) {
        CHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_BLOCKING));
        dst_active = ISC_TRUE;
 
-       CHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE));
-       hash_active = ISC_TRUE;
-
        if (logfile != NULL) {
                isc_logdestination_t destination;
                isc_logconfig_t *logconfig = NULL;
@@ -303,11 +300,6 @@ ns_test_end(void) {
 
        cleanup_managers();
 
-       if (hash_active) {
-               isc_hash_destroy();
-               hash_active = ISC_FALSE;
-       }
-
        if (ectx != NULL)
                isc_entropy_detach(&ectx);