@pytest.fixture(scope="module")
def default_algorithm():
- return isctest.vars.algorithms.Algorithm.default()
+ return isctest.algorithms.Algorithm.default()
@pytest.fixture(scope="module")
from re import compile as Re
from dnssec_py.common import DNSSEC_PY_MARK
+from isctest.algorithms import Algorithm
from isctest.template import NS2, NS3, zones
-from isctest.vars.algorithms import Algorithm
from isctest.zone import Zone, configure_root
import isctest
# information regarding copyright ownership.
from . import ( # pylint: disable=redefined-builtin
+ algorithms,
check,
hypothesis,
instance,
# instead.
__all__ = [
+ "algorithms",
"check",
"hypothesis",
"instance",
--- /dev/null
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+#
+# SPDX-License-Identifier: MPL-2.0
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, you can obtain one at https://mozilla.org/MPL/2.0/.
+#
+# See the COPYRIGHT file distributed with this work for additional
+# information regarding copyright ownership.
+
+from typing import NamedTuple
+
+import os
+
+
+class Algorithm(NamedTuple):
+ name: str
+ number: int
+ dst: int
+ bits: int
+
+ @classmethod
+ def default(cls):
+ return cls(
+ os.environ["DEFAULT_ALGORITHM"],
+ int(os.environ["DEFAULT_ALGORITHM_NUMBER"]),
+ int(os.environ["DEFAULT_ALGORITHM_DST_NUMBER"]),
+ int(os.environ["DEFAULT_BITS"]),
+ )
+
+
+RSASHA1 = Algorithm("RSASHA1", 5, 5, 2048)
+NSEC3RSASHA1 = Algorithm("NSEC3RSASHA1", 7, 7, 2048)
+RSASHA256 = Algorithm("RSASHA256", 8, 8, 2048)
+RSASHA512 = Algorithm("RSASHA512", 10, 10, 2048)
+ECDSAP256SHA256 = Algorithm("ECDSAP256SHA256", 13, 13, 256)
+ECDSAP384SHA384 = Algorithm("ECDSAP384SHA384", 14, 14, 384)
+ED25519 = Algorithm("ED25519", 15, 15, 256)
+ED448 = Algorithm("ED448", 16, 16, 456)
+RSASHA256OID = Algorithm("RSASHA256OID", 254, 256, 2048)
+RSASHA512OID = Algorithm("RSASHA512OID", 254, 257, 2048)
+
+ALL_ALGORITHMS = [
+ RSASHA1,
+ NSEC3RSASHA1,
+ RSASHA256,
+ RSASHA512,
+ ECDSAP256SHA256,
+ ECDSAP384SHA384,
+ ED25519,
+ ED448,
+ RSASHA256OID,
+ RSASHA512OID,
+]
+
+ALL_ALGORITHMS_BY_NUM = {alg.number: alg for alg in ALL_ALGORITHMS}
+# Keyed by the DST identifier rather than the on-wire number: unlike `number`
+# (where both private-OID variants collide at 254), `dst` is unique, so this
+# map distinguishes RSASHA256OID (256) from RSASHA512OID (257).
+ALL_ALGORITHMS_BY_DST = {alg.dst: alg for alg in ALL_ALGORITHMS}
import dns.tsig
import dns.zone
+from isctest.algorithms import ALL_ALGORITHMS_BY_DST, ECDSAP256SHA256, Algorithm
from isctest.instance import NamedInstance
from isctest.run import EnvCmd
-from isctest.vars.algorithms import ALL_ALGORITHMS_BY_DST, ECDSAP256SHA256, Algorithm
from isctest.zone import FileZoneKey
import isctest.log
import time
from .. import log
+from ..algorithms import (
+ ALL_ALGORITHMS,
+ ECDSAP256SHA256,
+ ECDSAP384SHA384,
+ ED448,
+ ED25519,
+ RSASHA256,
+ RSASHA512,
+ Algorithm,
+)
from .basic import BASIC_VARS
# Algorithms are selected randomly at runtime from a list of supported
"""number of secs during which algorithm selection remains stable"""
-class Algorithm(NamedTuple):
- name: str
- number: int
- dst: int
- bits: int
-
- @classmethod
- def default(cls):
- return cls(
- os.environ["DEFAULT_ALGORITHM"],
- int(os.environ["DEFAULT_ALGORITHM_NUMBER"]),
- int(os.environ["DEFAULT_ALGORITHM_DST_NUMBER"]),
- int(os.environ["DEFAULT_BITS"]),
- )
-
-
class AlgorithmSet(NamedTuple):
"""Collection of DEFAULT, ALTERNATIVE and DISABLED algorithms"""
"disable-algorithms" configuration option."""
-RSASHA1 = Algorithm("RSASHA1", 5, 5, 2048)
-NSEC3RSASHA1 = Algorithm("NSEC3RSASHA1", 7, 7, 2048)
-RSASHA256 = Algorithm("RSASHA256", 8, 8, 2048)
-RSASHA512 = Algorithm("RSASHA512", 10, 10, 2048)
-ECDSAP256SHA256 = Algorithm("ECDSAP256SHA256", 13, 13, 256)
-ECDSAP384SHA384 = Algorithm("ECDSAP384SHA384", 14, 14, 384)
-ED25519 = Algorithm("ED25519", 15, 15, 256)
-ED448 = Algorithm("ED448", 16, 16, 456)
-RSASHA256OID = Algorithm("RSASHA256OID", 254, 256, 2048)
-RSASHA512OID = Algorithm("RSASHA512OID", 254, 257, 2048)
-
-ALL_ALGORITHMS = [
- RSASHA1,
- NSEC3RSASHA1,
- RSASHA256,
- RSASHA512,
- ECDSAP256SHA256,
- ECDSAP384SHA384,
- ED25519,
- ED448,
- RSASHA256OID,
- RSASHA512OID,
-]
-
-ALL_ALGORITHMS_BY_NUM = {alg.number: alg for alg in ALL_ALGORITHMS}
-# Keyed by the DST identifier rather than the on-wire number: unlike `number`
-# (where both private-OID variants collide at 254), `dst` is unique, so this
-# map distinguishes RSASHA256OID (256) from RSASHA512OID (257).
-ALL_ALGORITHMS_BY_DST = {alg.dst: alg for alg in ALL_ALGORITHMS}
-
ALGORITHM_SETS = {
"stable": AlgorithmSet(
default=ECDSAP256SHA256, alternative=RSASHA256, disabled=ECDSAP384SHA384
import dns.rrset
import dns.zonefile
-from .log import debug
-from .run import EnvCmd
-from .template import NS1, Nameserver, TemplateEngine, TrustAnchor
-from .vars.algorithms import (
+from .algorithms import (
ALL_ALGORITHMS_BY_NUM,
ECDSAP256SHA256,
ECDSAP384SHA384,
ED25519,
Algorithm,
)
+from .log import debug
+from .run import EnvCmd
+from .template import NS1, Nameserver, TemplateEngine, TrustAnchor
KEYDIR = "keys"
DNSKEY_TTL = 3600
import dns.update
import pytest
+from isctest.algorithms import ECDSAP256SHA256, ECDSAP384SHA384, Algorithm
from isctest.kasp import KeyProperties, KeyTimingMetadata, SettimeOptions
from isctest.util import param
-from isctest.vars.algorithms import ECDSAP256SHA256, ECDSAP384SHA384, Algorithm
import isctest
import isctest.mark
import pytest
+from isctest.algorithms import Algorithm
from isctest.kasp import KeyTimingMetadata
-from isctest.vars.algorithms import Algorithm
from rollover.common import TIMEDELTA
import isctest
import pytest
-from isctest.vars.algorithms import Algorithm
+from isctest.algorithms import Algorithm
import isctest
import dns.rdatatype
import pytest
-from isctest.vars.algorithms import Algorithm
+from isctest.algorithms import Algorithm
from nsec3.common import NSEC3_MARK, check_nsec3_case
import isctest
import dns.update
import pytest
-from isctest.vars.algorithms import RSASHA1, Algorithm
+from isctest.algorithms import RSASHA1, Algorithm
from nsec3.common import NSEC3_MARK, check_nsec3_case
import isctest
import dns.rdatatype
import pytest
-from isctest.vars.algorithms import RSASHA1, Algorithm
+from isctest.algorithms import RSASHA1, Algorithm
from nsec3.common import NSEC3_MARK, check_nsec3_case
import isctest
import dns.rdatatype
import pytest
-from isctest.vars.algorithms import Algorithm
+from isctest.algorithms import Algorithm
from nsec3.common import NSEC3_MARK, check_nsec3_case, check_nsec3param
import isctest
import dns.rcode
import dns.rdatatype
-from isctest.vars.algorithms import RSASHA256
+from isctest.algorithms import RSASHA256
from nsec3.common import NSEC3_MARK, check_auth_nsec3, check_nsec3param
import isctest
import shutil
+from isctest.algorithms import Algorithm
from isctest.kasp import SettimeOptions, private_type_record
from isctest.run import EnvCmd
from isctest.template import NS2, NS3, TrustAnchor, Zone
-from isctest.vars.algorithms import Algorithm
import isctest
from datetime import timedelta
+from isctest.algorithms import Algorithm
from isctest.kasp import (
Ipub,
Iret,
)
from isctest.run import EnvCmd
from isctest.template import NS3, Zone
-from isctest.vars.algorithms import Algorithm
from rollover.setup import configure_root, configure_tld, setkeytimes
import isctest