pgreco / rpms / golang

Forked from rpms/golang 5 years ago
Clone

Blame SOURCES/golang-1.2-remove-ECC-p224.patch

4d1d36
diff -r 87dea3f5ebe7 api/go1.txt
4d1d36
--- a/api/go1.txt	Fri Nov 29 08:32:31 2013 +1100
4d1d36
+++ b/api/go1.txt	Fri Dec 06 13:31:29 2013 -0500
4d1d36
@@ -412,7 +412,6 @@
4d1d36
 pkg crypto/ecdsa, type PublicKey struct, embedded elliptic.Curve
4d1d36
 pkg crypto/elliptic, func GenerateKey(Curve, io.Reader) ([]uint8, *big.Int, *big.Int, error)
4d1d36
 pkg crypto/elliptic, func Marshal(Curve, *big.Int, *big.Int) []uint8
4d1d36
-pkg crypto/elliptic, func P224() Curve
4d1d36
 pkg crypto/elliptic, func P256() Curve
4d1d36
 pkg crypto/elliptic, func P384() Curve
4d1d36
 pkg crypto/elliptic, func P521() Curve
4d1d36
diff -r 87dea3f5ebe7 src/pkg/crypto/ecdsa/ecdsa_test.go
4d1d36
--- a/src/pkg/crypto/ecdsa/ecdsa_test.go	Fri Nov 29 08:32:31 2013 +1100
4d1d36
+++ b/src/pkg/crypto/ecdsa/ecdsa_test.go	Fri Dec 06 13:31:29 2013 -0500
4d1d36
@@ -33,7 +33,6 @@
4d1d36
 }
4d1d36
 
4d1d36
 func TestKeyGeneration(t *testing.T) {
4d1d36
-	testKeyGeneration(t, elliptic.P224(), "p224")
4d1d36
 	if testing.Short() {
4d1d36
 		return
4d1d36
 	}
4d1d36
@@ -63,7 +62,6 @@
4d1d36
 }
4d1d36
 
4d1d36
 func TestSignAndVerify(t *testing.T) {
4d1d36
-	testSignAndVerify(t, elliptic.P224(), "p224")
4d1d36
 	if testing.Short() {
4d1d36
 		return
4d1d36
 	}
4d1d36
@@ -129,8 +127,6 @@
4d1d36
 			parts := strings.SplitN(line, ",", 2)
4d1d36
 
4d1d36
 			switch parts[0] {
4d1d36
-			case "P-224":
4d1d36
-				pub.Curve = elliptic.P224()
4d1d36
 			case "P-256":
4d1d36
 				pub.Curve = elliptic.P256()
4d1d36
 			case "P-384":
4d1d36
diff -r 87dea3f5ebe7 src/pkg/crypto/elliptic/bottombits.go
4d1d36
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
4d1d36
+++ b/src/pkg/crypto/elliptic/bottombits.go	Fri Dec 06 13:31:29 2013 -0500
4d1d36
@@ -0,0 +1,14 @@
4d1d36
+
4d1d36
+// Copyright 2012 The Go Authors.  All rights reserved.
4d1d36
+// Use of this source code is governed by a BSD-style
4d1d36
+// license that can be found in the LICENSE file.
4d1d36
+
4d1d36
+package elliptic
4d1d36
+
4d1d36
+const bottom12Bits = 0xfff
4d1d36
+const bottom28Bits = 0xfffffff
4d1d36
+
4d1d36
+const two31p3 = 1<<31 + 1<<3
4d1d36
+const two31m3 = 1<<31 - 1<<3
4d1d36
+const two31m15m3 = 1<<31 - 1<<15 - 1<<3
4d1d36
+
4d1d36
diff -r 87dea3f5ebe7 src/pkg/crypto/elliptic/elliptic.go
4d1d36
--- a/src/pkg/crypto/elliptic/elliptic.go	Fri Nov 29 08:32:31 2013 +1100
4d1d36
+++ b/src/pkg/crypto/elliptic/elliptic.go	Fri Dec 06 13:31:29 2013 -0500
4d1d36
@@ -326,7 +326,6 @@
4d1d36
 var p521 *CurveParams
4d1d36
 
4d1d36
 func initAll() {
4d1d36
-	initP224()
4d1d36
 	initP256()
4d1d36
 	initP384()
4d1d36
 	initP521()
4d1d36
diff -r 87dea3f5ebe7 src/pkg/crypto/elliptic/elliptic_test.go
4d1d36
--- a/src/pkg/crypto/elliptic/elliptic_test.go	Fri Nov 29 08:32:31 2013 +1100
4d1d36
+++ b/src/pkg/crypto/elliptic/elliptic_test.go	Fri Dec 06 13:31:29 2013 -0500
4d1d36
@@ -1,3 +1,5 @@
4d1d36
+// +build ignore
4d1d36
+
4d1d36
 // Copyright 2010 The Go Authors. All rights reserved.
4d1d36
 // Use of this source code is governed by a BSD-style
4d1d36
 // license that can be found in the LICENSE file.
4d1d36
diff -r 87dea3f5ebe7 src/pkg/crypto/elliptic/p224.go
4d1d36
--- a/src/pkg/crypto/elliptic/p224.go	Fri Nov 29 08:32:31 2013 +1100
4d1d36
+++ b/src/pkg/crypto/elliptic/p224.go	Fri Dec 06 13:31:29 2013 -0500
4d1d36
@@ -1,3 +1,5 @@
4d1d36
+// +build ignore
4d1d36
+
4d1d36
 // Copyright 2012 The Go Authors.  All rights reserved.
4d1d36
 // Use of this source code is governed by a BSD-style
4d1d36
 // license that can be found in the LICENSE file.
4d1d36
@@ -183,10 +185,6 @@
4d1d36
 	}
4d1d36
 }
4d1d36
 
4d1d36
-const two31p3 = 1<<31 + 1<<3
4d1d36
-const two31m3 = 1<<31 - 1<<3
4d1d36
-const two31m15m3 = 1<<31 - 1<<15 - 1<<3
4d1d36
-
4d1d36
 // p224ZeroModP31 is 0 mod p where bit 31 is set in all limbs so that we can
4d1d36
 // subtract smaller amounts without underflow. See the section "Subtraction" in
4d1d36
 // [1] for reasoning.
4d1d36
@@ -215,9 +213,6 @@
4d1d36
 // "Subtraction" in [1] for why.
4d1d36
 var p224ZeroModP63 = [8]uint64{two63p35, two63m35, two63m35, two63m35, two63m35m19, two63m35, two63m35, two63m35}
4d1d36
 
4d1d36
-const bottom12Bits = 0xfff
4d1d36
-const bottom28Bits = 0xfffffff
4d1d36
-
4d1d36
 // p224Mul computes *out = a*b
4d1d36
 //
4d1d36
 // a[i] < 2**29, b[i] < 2**30 (or vice versa)
4d1d36
diff -r 87dea3f5ebe7 src/pkg/crypto/elliptic/p224_test.go
4d1d36
--- a/src/pkg/crypto/elliptic/p224_test.go	Fri Nov 29 08:32:31 2013 +1100
4d1d36
+++ b/src/pkg/crypto/elliptic/p224_test.go	Fri Dec 06 13:31:29 2013 -0500
4d1d36
@@ -1,3 +1,5 @@
4d1d36
+// +build ignore
4d1d36
+
4d1d36
 // Copyright 2012 The Go Authors.  All rights reserved.
4d1d36
 // Use of this source code is governed by a BSD-style
4d1d36
 // license that can be found in the LICENSE file.
4d1d36
diff -r 87dea3f5ebe7 src/pkg/crypto/x509/x509.go
4d1d36
--- a/src/pkg/crypto/x509/x509.go	Fri Nov 29 08:32:31 2013 +1100
4d1d36
+++ b/src/pkg/crypto/x509/x509.go	Fri Dec 06 13:31:29 2013 -0500
4d1d36
@@ -305,9 +305,6 @@
4d1d36
 
4d1d36
 // RFC 5480, 2.1.1.1. Named Curve
4d1d36
 //
4d1d36
-// secp224r1 OBJECT IDENTIFIER ::= {
4d1d36
-//   iso(1) identified-organization(3) certicom(132) curve(0) 33 }
4d1d36
-//
4d1d36
 // secp256r1 OBJECT IDENTIFIER ::= {
4d1d36
 //   iso(1) member-body(2) us(840) ansi-X9-62(10045) curves(3)
4d1d36
 //   prime(1) 7 }
4d1d36
@@ -320,7 +317,6 @@
4d1d36
 //
4d1d36
 // NB: secp256r1 is equivalent to prime256v1
4d1d36
 var (
4d1d36
-	oidNamedCurveP224 = asn1.ObjectIdentifier{1, 3, 132, 0, 33}
4d1d36
 	oidNamedCurveP256 = asn1.ObjectIdentifier{1, 2, 840, 10045, 3, 1, 7}
4d1d36
 	oidNamedCurveP384 = asn1.ObjectIdentifier{1, 3, 132, 0, 34}
4d1d36
 	oidNamedCurveP521 = asn1.ObjectIdentifier{1, 3, 132, 0, 35}
4d1d36
@@ -328,8 +324,6 @@
4d1d36
 
4d1d36
 func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve {
4d1d36
 	switch {
4d1d36
-	case oid.Equal(oidNamedCurveP224):
4d1d36
-		return elliptic.P224()
4d1d36
 	case oid.Equal(oidNamedCurveP256):
4d1d36
 		return elliptic.P256()
4d1d36
 	case oid.Equal(oidNamedCurveP384):
4d1d36
@@ -342,8 +336,6 @@
4d1d36
 
4d1d36
 func oidFromNamedCurve(curve elliptic.Curve) (asn1.ObjectIdentifier, bool) {
4d1d36
 	switch curve {
4d1d36
-	case elliptic.P224():
4d1d36
-		return oidNamedCurveP224, true
4d1d36
 	case elliptic.P256():
4d1d36
 		return oidNamedCurveP256, true
4d1d36
 	case elliptic.P384():
4d1d36
@@ -1373,7 +1365,7 @@
4d1d36
 		hashFunc = crypto.SHA1
4d1d36
 	case *ecdsa.PrivateKey:
4d1d36
 		switch priv.Curve {
4d1d36
-		case elliptic.P224(), elliptic.P256():
4d1d36
+		case elliptic.P256():
4d1d36
 			hashFunc = crypto.SHA256
4d1d36
 			signatureAlgorithm.Algorithm = oidSignatureECDSAWithSHA256
4d1d36
 		case elliptic.P384():