Skip to content

Commit

Permalink
fix: Drop incomplete support for DSA/SHA1 (#55)
Browse files Browse the repository at this point in the history
See #50.
  • Loading branch information
gnarea authored Nov 18, 2022
1 parent 09429c9 commit 4bd3ff8
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ This library supports producing RRSig records simply for testing purposes: It ma

We support all the _Zone Signing_ [DNSSEC algorithms](https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml#dns-sec-alg-numbers-1) as of 2022, except for:

- DSA (`3`) because [it's too insecure and hardly used](https://github.com/relaycorp/dnssec-js/issues/50).
- NSEC3 (`6` and `7`) because [we don't currently support Denial of Existence records](https://github.com/relaycorp/dnssec-js/issues/17).
- [GOST](https://en.wikipedia.org/wiki/GOST) (`12`) due to lack of support in Node.js, and its lack of popularity and security doesn't seem to justify integrating a third party NPM package supporting it (assuming a suitable one exists).
- Private algorithms (`253` and `254`) because we have no use for those, but we'd welcome PRs to implement them.
2 changes: 1 addition & 1 deletion src/lib/DnssecAlgorithm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @link https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml
*/
export enum DnssecAlgorithm {
DSA = 3,
// DSA = 3, // See: https://github.com/relaycorp/dnssec-js/issues/50
RSASHA1 = 5,
RSASHA256 = 8,
RSASHA512 = 10,
Expand Down
1 change: 0 additions & 1 deletion src/lib/signing/keyGen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const RSA_OPTIONS = {
options: { modulusLength: 2048 },
};
const KEY_GEN_OPTIONS: { readonly [key in DnssecAlgorithm]: KeyGenOptions } = {
[DnssecAlgorithm.DSA]: { type: 'dsa' },
[DnssecAlgorithm.ECDSAP256SHA256]: { type: 'ec', options: { namedCurve: 'prime256v1' } },
[DnssecAlgorithm.ECDSAP384SHA384]: { type: 'ec', options: { namedCurve: 'secp384r1' } },
[DnssecAlgorithm.RSASHA1]: RSA_OPTIONS,
Expand Down
1 change: 0 additions & 1 deletion src/lib/utils/crypto/hashing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { DnssecAlgorithm } from '../../DnssecAlgorithm';

describe('getNodejsHashAlgorithmFromDnssecAlgo', () => {
test.each([
[DnssecAlgorithm.DSA, 'sha1'],
[DnssecAlgorithm.RSASHA1, 'sha1'],
[DnssecAlgorithm.RSASHA256, 'sha256'],
[DnssecAlgorithm.RSASHA512, 'sha512'],
Expand Down
1 change: 0 additions & 1 deletion src/lib/utils/crypto/hashing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { DigestType } from '../../DigestType';
import { DnssecAlgorithm } from '../../DnssecAlgorithm';

const HASH_BY_DNSSEC_ALGO: { readonly [algo in DnssecAlgorithm]: string | null } = {
[DnssecAlgorithm.DSA]: 'sha1',
[DnssecAlgorithm.RSASHA1]: 'sha1',
[DnssecAlgorithm.RSASHA256]: 'sha256',
[DnssecAlgorithm.RSASHA512]: 'sha512',
Expand Down

0 comments on commit 4bd3ff8

Please sign in to comment.