Skip to content

Instantly share code, notes, and snippets.

@timbertson
Created August 28, 2014 00:10
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 timbertson/973a74e2c7d4020e5258 to your computer and use it in GitHub Desktop.
Save timbertson/973a74e2c7d4020e5258 to your computer and use it in GitHub Desktop.
etcd-ca-disable-p224.patch
diff --git a/pkcs10.go b/pkcs10.go
index a257e20..6550702 100644
--- a/pkcs10.go
+++ b/pkcs10.go
@@ -169,9 +169,9 @@ func CreateCertificateSigningRequest(rand io.Reader, template *CertificateSignin
publicKeyAlgorithm.Algorithm = oidPublicKeyRSA
case *ecdsa.PrivateKey:
switch priv.Curve {
- case elliptic.P224(), elliptic.P256():
- hashFunc = crypto.SHA256
- signatureAlgorithm.Algorithm = oidSignatureECDSAWithSHA256
+ //case elliptic.P224(), elliptic.P256():
+ //hashFunc = crypto.SHA256
+ //signatureAlgorithm.Algorithm = oidSignatureECDSAWithSHA256
case elliptic.P384():
hashFunc = crypto.SHA384
signatureAlgorithm.Algorithm = oidSignatureECDSAWithSHA384
diff --git a/x509.go b/x509.go
index 85dfa7b..bbf5b0f 100644
--- a/x509.go
+++ b/x509.go
@@ -172,7 +172,7 @@ type rsaPublicKey struct {
}
var (
- oidNamedCurveP224 = asn1.ObjectIdentifier{1, 3, 132, 0, 33}
+ //oidNamedCurveP224 = asn1.ObjectIdentifier{1, 3, 132, 0, 33}
oidNamedCurveP256 = asn1.ObjectIdentifier{1, 2, 840, 10045, 3, 1, 7}
oidNamedCurveP384 = asn1.ObjectIdentifier{1, 3, 132, 0, 34}
oidNamedCurveP521 = asn1.ObjectIdentifier{1, 3, 132, 0, 35}
@@ -180,8 +180,8 @@ var (
func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve {
switch {
- case oid.Equal(oidNamedCurveP224):
- return elliptic.P224()
+ //case oid.Equal(oidNamedCurveP224):
+ //return elliptic.P224()
case oid.Equal(oidNamedCurveP256):
return elliptic.P256()
case oid.Equal(oidNamedCurveP384):
@@ -194,8 +194,8 @@ func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve {
func oidFromNamedCurve(curve elliptic.Curve) (asn1.ObjectIdentifier, bool) {
switch curve {
- case elliptic.P224():
- return oidNamedCurveP224, true
+ //case elliptic.P224():
+ //return oidNamedCurveP224, true
case elliptic.P256():
return oidNamedCurveP256, true
case elliptic.P384():
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment