Created
April 20, 2022 23:20
-
-
Save liquidz/0868f75a9043c356945b916e2d0a7d7d to your computer and use it in GitHub Desktop.
CVE-2022-21449 checker
This file contains hidden or 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
(ns cve-2022-21449 | |
(:import | |
(java.security | |
KeyPairGenerator | |
Signature))) | |
(def key-pair | |
(.. (KeyPairGenerator/getInstance "EC") | |
(generateKeyPair))) | |
(def blank-signature | |
(byte-array 64)) | |
(defn -main | |
[& _] | |
(let [sig (doto (Signature/getInstance "SHA256WithECDSAInP1363Format") | |
(.initVerify (.getPublic key-pair)) | |
(.update (.getBytes "Hello World")))] | |
(println | |
(.verify sig blank-signature)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment