mirror of
https://github.com/golang/go.git
synced 2024-09-30 23:07:22 +00:00
crypto/rsa: fix shadowing error.
Fixes bug 375. R=rsc https://golang.org/cl/165045
This commit is contained in:
parent
cf37254b1c
commit
e93132c982
@ -159,12 +159,12 @@ func GenerateKey(rand io.Reader, bits int) (priv *PrivateKey, err os.Error) {
|
|||||||
for {
|
for {
|
||||||
p, err := randomSafePrime(rand, bits/2);
|
p, err := randomSafePrime(rand, bits/2);
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
q, err := randomSafePrime(rand, bits/2);
|
q, err := randomSafePrime(rand, bits/2);
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.Cmp(q) == 0 {
|
if p.Cmp(q) == 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user