Skip to content

Commit 0eb9dd4

Browse files
authored
fix DSA param variable names (#183)
1 parent 4384f83 commit 0eb9dd4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dsa.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ func GenerateKeyDSA(params DSAParameters) (*PrivateKeyDSA, error) {
164164
C.go_openssl_BN_clear_free(x)
165165
C.go_openssl_BN_free(y)
166166
}()
167-
if C.go_openssl_EVP_PKEY_get_bn_param(pkey, paramPubKey, &y) != 1 ||
168-
C.go_openssl_EVP_PKEY_get_bn_param(pkey, paramPrivKey, &x) != 1 {
167+
if C.go_openssl_EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_PUB_KEY, &y) != 1 ||
168+
C.go_openssl_EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_PRIV_KEY, &x) != 1 {
169169
return nil, newOpenSSLError("EVP_PKEY_get_bn_param")
170170
}
171171
default:
@@ -275,7 +275,7 @@ func newDSA3(params DSAParameters, x, y BigInt) (C.GO_EVP_PKEY_PTR, error) {
275275
if y != nil {
276276
pub := bigToBN(y)
277277
defer C.go_openssl_BN_free(pub)
278-
if C.go_openssl_OSSL_PARAM_BLD_push_BN(bld, paramPubKey, pub) != 1 {
278+
if C.go_openssl_OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_PUB_KEY, pub) != 1 {
279279
return nil, newOpenSSLError("OSSL_PARAM_BLD_push_BN")
280280
}
281281
if x == nil {
@@ -285,7 +285,7 @@ func newDSA3(params DSAParameters, x, y BigInt) (C.GO_EVP_PKEY_PTR, error) {
285285
if x != nil {
286286
priv := bigToBN(x)
287287
defer C.go_openssl_BN_clear_free(priv)
288-
if C.go_openssl_OSSL_PARAM_BLD_push_BN(bld, paramPrivKey, priv) != 1 {
288+
if C.go_openssl_OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_PRIV_KEY, priv) != 1 {
289289
return nil, newOpenSSLError("OSSL_PARAM_BLD_push_BN")
290290
}
291291
}

0 commit comments

Comments
 (0)