mirror of
https://github.com/libp2p/go-openssl.git
synced 2024-12-27 23:40:18 +08:00
fix taking address of first element of empty byte slice
Change-Id: I57efec6116b688bf1aaa5da34280f76a0d9ec882
This commit is contained in:
parent
4eb00a0087
commit
11f8f384f4
@ -82,7 +82,7 @@ func NewGCMEncryptionCipherCtx(blocksize int, e *Engine, key, iv []byte) (
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if iv != nil {
|
||||
if len(iv) > 0 {
|
||||
err := ctx.setCtrl(C.EVP_CTRL_GCM_SET_IVLEN, len(iv))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not set IV len to %d: %s",
|
||||
@ -106,7 +106,7 @@ func NewGCMDecryptionCipherCtx(blocksize int, e *Engine, key, iv []byte) (
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if iv != nil {
|
||||
if len(iv) > 0 {
|
||||
err := ctx.setCtrl(C.EVP_CTRL_GCM_SET_IVLEN, len(iv))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not set IV len to %d: %s",
|
||||
|
Loading…
Reference in New Issue
Block a user