mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-09-25 23:04:10 +08:00
first step of v2 final release
This commit is contained in:
@@ -18,7 +18,7 @@ func SeedRandom(seed []byte) error {
|
||||
|
||||
func GenerateRandom(length int) ([]byte, error) {
|
||||
outbuf := make([]byte, length)
|
||||
if 1 != C.RAND_bytes((*C.uchar)(&outbuf[0]), C.int(length)) {
|
||||
if C.RAND_bytes((*C.uchar)(&outbuf[0]), C.int(length)) <= 0 {
|
||||
return nil, errors.New("GmSSL Failure")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user