Skip to content

Instantly share code, notes, and snippets.

@liquidz
Created April 20, 2022 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liquidz/0868f75a9043c356945b916e2d0a7d7d to your computer and use it in GitHub Desktop.
Save liquidz/0868f75a9043c356945b916e2d0a7d7d to your computer and use it in GitHub Desktop.
CVE-2022-21449 checker
(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