first step of v2 final release

This commit is contained in:
Zhi Guan
2017-11-05 21:00:36 +08:00
parent 480b9e8d88
commit 27bde477a5
395 changed files with 26341 additions and 31364 deletions

View File

@@ -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")
}