Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Davis Goodin <[email protected]>
  • Loading branch information
qmuntal and dagood authored Sep 7, 2023
1 parent 4a7159f commit 2572083
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (ctx evpPkeyCtx) setHKDFProps(mode int, md C.GO_EVP_MD_PTR, key []byte, sal
}
if key != nil {
if C.go_openssl_EVP_PKEY_CTX_set1_hkdf_key(ctx.ptr, base(key), C.int(len(key))) != 1 {
return newOpenSSLError("gEVP_PKEY_CTX_set1_hkdf_key")
return newOpenSSLError("EVP_PKEY_CTX_set1_hkdf_key")
}
}
if salt != nil {
Expand Down Expand Up @@ -222,13 +222,11 @@ func (ctx evpPkeyCtx) setTLS1PRFProps(md C.GO_EVP_MD_PTR, secret []byte, seeds .
if C.go_openssl_EVP_PKEY_CTX_set_tls1_prf_md(ctx.ptr, md) != 1 {
return newOpenSSLError("EVP_PKEY_CTX_set_tls1_prf_md")
}
if C.go_openssl_EVP_PKEY_CTX_set1_tls1_prf_secret(ctx.ptr,
base(secret), C.int(len(secret))) != 1 {
if C.go_openssl_EVP_PKEY_CTX_set1_tls1_prf_secret(ctx.ptr, base(secret), C.int(len(secret))) != 1 {
return newOpenSSLError("EVP_PKEY_CTX_set1_tls1_prf_secret")
}
for _, s := range seeds {
if C.go_openssl_EVP_PKEY_CTX_add1_tls1_prf_seed(ctx.ptr,
base(s), C.int(len(s))) != 1 {
if C.go_openssl_EVP_PKEY_CTX_add1_tls1_prf_seed(ctx.ptr, base(s), C.int(len(s))) != 1 {
return newOpenSSLError("EVP_PKEY_CTX_add1_tls1_prf_seed")
}
}
Expand Down
2 changes: 1 addition & 1 deletion evp.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ func evpDecrypt(withKey withKeyFunc, padding int, h, mgfHash hash.Hash, label, m
}

func evpSign(withKey withKeyFunc, padding int, saltLen int, h crypto.Hash, hashed []byte) ([]byte, error) {
signtInit := func(ctx evpPkeyCtx) error {
signInit := func(ctx evpPkeyCtx) error {
return ctx.signInit()
}
sign := func(ctx evpPkeyCtx, out, in []byte) ([]byte, error) {
Expand Down

0 comments on commit 2572083

Please sign in to comment.