Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
2e3dc2cc
Commit
2e3dc2cc
authored
Jul 13, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypto/rand: add missing Unlock
R=r CC=golang-dev
https://golang.org/cl/1812043
parent
0c2e6b36
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
0 deletions
+2
-0
rand_unix.go
src/pkg/crypto/rand/rand_unix.go
+1
-0
rand_windows.go
src/pkg/crypto/rand/rand_windows.go
+1
-0
No files found.
src/pkg/crypto/rand/rand_unix.go
View file @
2e3dc2cc
...
@@ -32,6 +32,7 @@ func (r *devReader) Read(b []byte) (n int, err os.Error) {
...
@@ -32,6 +32,7 @@ func (r *devReader) Read(b []byte) (n int, err os.Error) {
if
r
.
f
==
nil
{
if
r
.
f
==
nil
{
f
,
err
:=
os
.
Open
(
r
.
name
,
os
.
O_RDONLY
,
0
)
f
,
err
:=
os
.
Open
(
r
.
name
,
os
.
O_RDONLY
,
0
)
if
f
==
nil
{
if
f
==
nil
{
r
.
mu
.
Unlock
()
return
0
,
err
return
0
,
err
}
}
r
.
f
=
f
r
.
f
=
f
...
...
src/pkg/crypto/rand/rand_windows.go
View file @
2e3dc2cc
...
@@ -30,6 +30,7 @@ func (r *rngReader) Read(b []byte) (n int, err os.Error) {
...
@@ -30,6 +30,7 @@ func (r *rngReader) Read(b []byte) (n int, err os.Error) {
const
flags
=
syscall
.
CRYPT_VERIFYCONTEXT
|
syscall
.
CRYPT_SILENT
const
flags
=
syscall
.
CRYPT_VERIFYCONTEXT
|
syscall
.
CRYPT_SILENT
ok
,
errno
:=
syscall
.
CryptAcquireContext
(
&
r
.
prov
,
nil
,
nil
,
provType
,
flags
)
ok
,
errno
:=
syscall
.
CryptAcquireContext
(
&
r
.
prov
,
nil
,
nil
,
provType
,
flags
)
if
!
ok
{
if
!
ok
{
r
.
mu
.
Unlock
()
return
0
,
os
.
NewSyscallError
(
"CryptAcquireContext"
,
errno
)
return
0
,
os
.
NewSyscallError
(
"CryptAcquireContext"
,
errno
)
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment