]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/rsa: fix shadowing error.
authorAdam Langley <agl@golang.org>
Fri, 4 Dec 2009 03:33:23 +0000 (19:33 -0800)
committerAdam Langley <agl@golang.org>
Fri, 4 Dec 2009 03:33:23 +0000 (19:33 -0800)
Fixes bug 375.

R=rsc
https://golang.org/cl/165045

src/pkg/crypto/rsa/rsa.go

index 0576bb6a76691362722cd913e034105ec6f93a49..e47b02060f5a77ff72c0157490f0cee0c3547365 100644 (file)
@@ -159,12 +159,12 @@ func GenerateKey(rand io.Reader, bits int) (priv *PrivateKey, err os.Error) {
        for {
                p, err := randomSafePrime(rand, bits/2);
                if err != nil {
-                       return
+                       return nil, err
                }
 
                q, err := randomSafePrime(rand, bits/2);
                if err != nil {
-                       return
+                       return nil, err
                }
 
                if p.Cmp(q) == 0 {