-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No v6 ECC keys with legacy OIDs (#234)
This PR addresses a compliance issue with RFC 9580, which mandates: "Implementations MUST NOT accept or generate version 6 key material using the deprecated OIDs." Currently, the implementation allows generation of v6 keys with deprecated OIDs, which violates the specification. This MR resolves the issue by introducing an error during key generation and parsing when deprecated OIDs are detected.
- Loading branch information
Showing
6 changed files
with
86 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,3 +224,21 @@ func TestKeyGenerationHighSecurityLevel(t *testing.T) { | |
} | ||
|
||
} | ||
|
||
func TestKeyGenLegacyECC(t *testing.T) { | ||
c := &packet.Config{ | ||
V6Keys: true, | ||
Algorithm: packet.PubKeyAlgoEdDSA, | ||
} | ||
_, err := NewEntity("V6 Key Owner", "V6 Key", "[email protected]", c) | ||
if err == nil { | ||
t.Fatal("should not be able to generate v6 keys with legacy OIDs") | ||
} | ||
} | ||
|
||
func TestReadLegacyECC(t *testing.T) { | ||
_, err := ReadArmoredKeyRing(strings.NewReader(LegacyECCKeyV6)) | ||
if err == nil { | ||
t.Fatal("should not be able to read v6 legacy ECC key") | ||
} | ||
} |