Skip to content

Commit

Permalink
Merge pull request #4740 from Habbie/fix-show-zone-ds
Browse files Browse the repository at this point in the history
avoid undefined behaviour in clang vs. gcc
  • Loading branch information
Habbie committed Dec 5, 2016
2 parents 61b4928 + 4743dfd commit 85ceefa
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pdns/pdnsutil.cc
Expand Up @@ -1668,12 +1668,14 @@ bool showZone(DNSSECKeeper& dk, const DNSName& zone, bool exportDS = false)
cout<<prefix<<zone.toString()<<" IN DS "<<makeDSFromDNSKey(zone, key, 1).getZoneRepresentation() << " ; ( SHA1 digest )" << endl;
cout<<prefix<<zone.toString()<<" IN DS "<<makeDSFromDNSKey(zone, key, 2).getZoneRepresentation() << " ; ( SHA256 digest )" << endl;
try {
cout<<prefix<<zone.toString()<<" IN DS "<<makeDSFromDNSKey(zone, key, 3).getZoneRepresentation() << " ; ( GOST R 34.11-94 digest )" << endl;
string output=makeDSFromDNSKey(zone, key, 3).getZoneRepresentation();
cout<<prefix<<zone.toString()<<" IN DS "<<output<< " ; ( GOST R 34.11-94 digest )" << endl;
}
catch(...)
{}
try {
cout<<prefix<<zone.toString()<<" IN DS "<<makeDSFromDNSKey(zone, key, 4).getZoneRepresentation() << " ; ( SHA-384 digest )" << endl;
string output=makeDSFromDNSKey(zone, key, 4).getZoneRepresentation();
cout<<prefix<<zone.toString()<<" IN DS "<<output<< " ; ( SHA-384 digest )" << endl;
}
catch(...)
{}
Expand Down Expand Up @@ -1717,12 +1719,14 @@ bool showZone(DNSSECKeeper& dk, const DNSName& zone, bool exportDS = false)
cout<<prefix<<zone.toString()<<" IN DS "<<makeDSFromDNSKey(zone, key, 1).getZoneRepresentation() << " ; ( SHA1 digest )" << endl;
cout<<prefix<<zone.toString()<<" IN DS "<<makeDSFromDNSKey(zone, key, 2).getZoneRepresentation() << " ; ( SHA256 digest )" << endl;
try {
cout<<prefix<<zone.toString()<<" IN DS "<<makeDSFromDNSKey(zone, key, 3).getZoneRepresentation() << " ; ( GOST R 34.11-94 digest )" << endl;
string output=makeDSFromDNSKey(zone, key, 3).getZoneRepresentation();
cout<<prefix<<zone.toString()<<" IN DS "<<output<< " ; ( GOST R 34.11-94 digest )" << endl;
}
catch(...)
{}
try {
cout<<prefix<<zone.toString()<<" IN DS "<<makeDSFromDNSKey(zone, key, 4).getZoneRepresentation() << " ; ( SHA-384 digest )" << endl;
string output=makeDSFromDNSKey(zone, key, 4).getZoneRepresentation();
cout<<prefix<<zone.toString()<<" IN DS "<<output<< " ; ( SHA-384 digest )" << endl;
}
catch(...)
{}
Expand Down

0 comments on commit 85ceefa

Please sign in to comment.