Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate case randomization feature #206

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Enabled by default.

=item --[no-]randomize

Experimental.
This feature is deprecated and will be removed in Zonemaster 2025.1.
Randomizes the capitalization of returned domain names.
Disabled by default.

Expand Down Expand Up @@ -298,6 +298,7 @@ else {

if ( $opt_randomize ) {
print "Feature randomized capitalization enabled\n";
print "WARNING: This feature is DEPRECATED and will be removed in Zonemaster v2025.1.\n";
cc_define '-DRANDOMIZE';
}
else {
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* [Ed25519]
* [IDN]
* [Internal ldns]
* [Randomized capitalization](#randomized-capitalization)
* [Randomized capitalization (deprecated)](#randomized-capitalization-deprecated)
* [Custom OpenSSL]
* [Custom LDNS]
* [Custom Libidn]
Expand Down Expand Up @@ -166,12 +166,12 @@ When enabled, an included version of ldns is statically linked into
Zonemaster::LDNS.
When disabled, libldns is dynamically linked just like other dependencies.

### Randomized capitalization
### Randomized capitalization (deprecated)

Disabled by default.
Enable with `--randomize`.

> **Note:** This feature is experimental.
> **Note:** This feature is deprecated and will be removed in Zonemaster 2025.1.

Randomizes the capitalization of returned domain names.

Expand Down
1 change: 1 addition & 0 deletions src/assist.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ char *
randomize_capitalization(char *in)
{
#ifdef RANDOMIZE
#warning "Case randomization is deprecated and will be removed in v2025.1."
char *str;
str = in;
while(*str) {
Expand Down
8 changes: 5 additions & 3 deletions t/rr.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use v5.16;

use Test::More;
use Test::Fatal;
use Devel::Peek;
Expand Down Expand Up @@ -67,7 +69,7 @@ subtest 'AAAA' => sub {
SKIP: {
skip 'no network', 1 unless $ENV{TEST_WITH_NETWORK};

$p = $s->query( 'a.ns.se', 'AAAA' );
my $p = $s->query( 'a.ns.se', 'AAAA' );
plan skip_all => 'No response, cannot test' if not $p;

foreach my $rr ( $p->answer ) {
Expand Down Expand Up @@ -286,7 +288,7 @@ subtest 'SPF' => sub {
subtest 'DNAME' => sub {
my $rr = Zonemaster::LDNS::RR->new( 'examplë.fake 3600 IN DNAME example.fake' );
isa_ok( $rr, 'Zonemaster::LDNS::RR::DNAME' );
is($rr->dname(), 'example.fake.');
is(fc($rr->dname()), fc('example.fake.'));
};

subtest 'croak when given malformed CAA records' => sub {
Expand All @@ -297,7 +299,7 @@ subtest 'croak when given malformed CAA records' => sub {
# This will always croak
$bad_caa->string();
};
like( exception { $will_croak->() }, qr/^Failed to convert RR to string/ );
like( exception(sub { $will_croak->() }), qr/^Failed to convert RR to string/ );
};

done_testing;