Lines Matching refs:priv_key

377 static void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key)  in DH_get0_key()  argument
380 *priv_key = dh->priv_key; in DH_get0_key()
383 static int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) in DH_set0_key() argument
386 dh->priv_key = priv_key; in DH_set0_key()
407 static void DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key) in DSA_get0_key() argument
410 *priv_key = d->priv_key; in DSA_get0_key()
413 int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key) in DSA_set0_key() argument
416 d->priv_key = priv_key; in DSA_set0_key()
646 EVP_PKEY * priv_key; member
1068 if (req->priv_key) { in php_openssl_dispose_config()
1069 EVP_PKEY_free(req->priv_key); in php_openssl_dispose_config()
1070 req->priv_key = NULL; in php_openssl_dispose_config()
2613 EVP_PKEY *priv_key = NULL; in PHP_FUNCTION() local
2634 priv_key = php_openssl_pkey_from_zval(zpkey, 0, "", 0, 3); in PHP_FUNCTION()
2635 if (priv_key == NULL) { in PHP_FUNCTION()
2641 if (!X509_check_private_key(cert, priv_key)) { in PHP_FUNCTION()
2670 p12 = PKCS12_create(pass, friendly_name, priv_key, cert, ca, 0, 0, 0, 0, 0); in PHP_FUNCTION()
2694 EVP_PKEY_free(priv_key); in PHP_FUNCTION()
2711 EVP_PKEY *priv_key = NULL; in PHP_FUNCTION() local
2735 priv_key = php_openssl_pkey_from_zval(zpkey, 0, "", 0, 3); in PHP_FUNCTION()
2736 if (priv_key == NULL) { in PHP_FUNCTION()
2742 if (!X509_check_private_key(cert, priv_key)) { in PHP_FUNCTION()
2760 p12 = PKCS12_create(pass, friendly_name, priv_key, cert, ca, 0, 0, 0, 0, 0); in PHP_FUNCTION()
2783 EVP_PKEY_free(priv_key); in PHP_FUNCTION()
3071 if (!X509_REQ_set_pubkey(csr, req->priv_key)) { in php_openssl_csr_make()
3245 EVP_PKEY * key = NULL, *priv_key = NULL; in PHP_FUNCTION() local
3279 priv_key = php_openssl_pkey_from_zval(zpkey, 0, "", 0, 3); in PHP_FUNCTION()
3280 if (priv_key == NULL) { in PHP_FUNCTION()
3286 if (cert && !X509_check_private_key(cert, priv_key)) { in PHP_FUNCTION()
3383 if (!X509_sign(new_cert, priv_key, req.digest)) { in PHP_FUNCTION()
3401 EVP_PKEY_free(priv_key); in PHP_FUNCTION()
3435 req.priv_key = php_openssl_pkey_from_zval(out_pkey_val, 0, NULL, 0, 2); in PHP_FUNCTION()
3437 if (req.priv_key == NULL) { in PHP_FUNCTION()
3441 if (req.priv_key == NULL) { in PHP_FUNCTION()
3461 if (X509_REQ_sign(csr, req.priv_key, req.digest)) { in PHP_FUNCTION()
3475 &zkey_object, req.priv_key, /* is_private */ true); in PHP_FUNCTION()
3477 req.priv_key = NULL; /* make sure the cleanup code doesn't zap it! */ in PHP_FUNCTION()
3525 static EVP_PKEY *php_openssl_extract_public_key(EVP_PKEY *priv_key) in php_openssl_extract_public_key() argument
3529 if (!bio || !PEM_write_bio_PUBKEY(bio, priv_key)) { in php_openssl_extract_public_key()
3905 req->priv_key = key; in php_openssl_generate_private_key()
4065 BIGNUM *p, *q, *g, *priv_key, *pub_key; in php_openssl_pkey_init_legacy_dsa() local
4076 OPENSSL_PKEY_SET_BN(data, priv_key); in php_openssl_pkey_init_legacy_dsa()
4077 *is_private = priv_key != NULL; in php_openssl_pkey_init_legacy_dsa()
4079 return DSA_set0_key(dsa, pub_key, priv_key); in php_openssl_pkey_init_legacy_dsa()
4104 BIGNUM *p = NULL, *q = NULL, *g = NULL, *priv_key = NULL, *pub_key = NULL; in php_openssl_pkey_init_dsa() local
4113 OPENSSL_PKEY_SET_BN(data, priv_key); in php_openssl_pkey_init_dsa()
4128 if (priv_key) { in php_openssl_pkey_init_dsa()
4129 OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_PRIV_KEY, priv_key); in php_openssl_pkey_init_dsa()
4144 *is_private = priv_key != NULL; in php_openssl_pkey_init_dsa()
4166 BN_free(priv_key); in php_openssl_pkey_init_dsa()
4196 static BIGNUM *php_openssl_dh_pub_from_priv(BIGNUM *priv_key, BIGNUM *g, BIGNUM *p) in php_openssl_dh_pub_from_priv() argument
4221 BN_with_flags(priv_key_const_time, priv_key, BN_FLG_CONSTTIME); in php_openssl_dh_pub_from_priv()
4239 BIGNUM *p, *q, *g, *priv_key, *pub_key; in php_openssl_pkey_init_legacy_dh() local
4248 OPENSSL_PKEY_SET_BN(data, priv_key); in php_openssl_pkey_init_legacy_dh()
4250 *is_private = priv_key != NULL; in php_openssl_pkey_init_legacy_dh()
4252 return DH_set0_key(dh, pub_key, priv_key); in php_openssl_pkey_init_legacy_dh()
4254 if (priv_key) { in php_openssl_pkey_init_legacy_dh()
4255 pub_key = php_openssl_dh_pub_from_priv(priv_key, g, p); in php_openssl_pkey_init_legacy_dh()
4259 return DH_set0_key(dh, pub_key, priv_key); in php_openssl_pkey_init_legacy_dh()
4277 BIGNUM *p = NULL, *q = NULL, *g = NULL, *priv_key = NULL, *pub_key = NULL; in php_openssl_pkey_init_dh() local
4286 OPENSSL_PKEY_SET_BN(data, priv_key); in php_openssl_pkey_init_dh()
4300 if (priv_key) { in php_openssl_pkey_init_dh()
4301 OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_PRIV_KEY, priv_key); in php_openssl_pkey_init_dh()
4303 pub_key = php_openssl_dh_pub_from_priv(priv_key, g, p); in php_openssl_pkey_init_dh()
4323 if (pub_key || priv_key) { in php_openssl_pkey_init_dh()
4324 *is_private = priv_key != NULL; in php_openssl_pkey_init_dh()
4346 BN_free(priv_key); in php_openssl_pkey_init_dh()
4758 zval *priv_key = zend_hash_str_find(Z_ARRVAL_P(data), "priv_key", sizeof("priv_key") - 1); in php_openssl_pkey_object_curve_25519_448() local
4759 if (priv_key && Z_TYPE_P(priv_key) == IS_STRING && Z_STRLEN_P(priv_key) > 0) { in php_openssl_pkey_object_curve_25519_448()
4760 …BLD_push_octet_string(bld, OSSL_PKEY_PARAM_PRIV_KEY, Z_STRVAL_P(priv_key), Z_STRLEN_P(priv_key))) { in php_openssl_pkey_object_curve_25519_448()
4778 if (pub_key || priv_key) { in php_openssl_pkey_object_curve_25519_448()
4783 is_private = priv_key != NULL; in php_openssl_pkey_object_curve_25519_448()
4882 php_openssl_pkey_object_init(return_value, req.priv_key, /* is_private */ true); in PHP_FUNCTION()
4884 req.priv_key = NULL; in PHP_FUNCTION()
5301 const BIGNUM *p, *q, *g, *priv_key, *pub_key; in PHP_FUNCTION() local
5304 DSA_get0_key(dsa, &pub_key, &priv_key); in PHP_FUNCTION()
5310 OPENSSL_PKEY_GET_BN(z_dsa, priv_key); in PHP_FUNCTION()
5323 const BIGNUM *p, *q, *g, *priv_key, *pub_key; in PHP_FUNCTION() local
5326 DH_get0_key(dh, &pub_key, &priv_key); in PHP_FUNCTION()
5331 OPENSSL_PKEY_GET_BN(z_dh, priv_key); in PHP_FUNCTION()
5499 zval *priv_key; in PHP_FUNCTION() local
5503 …if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz|l", &peer_pub_key, &priv_key, &key_len) == FAILURE)… in PHP_FUNCTION()
5512 EVP_PKEY *pkey = php_openssl_pkey_from_zval(priv_key, 0, "", 0, 2); in PHP_FUNCTION()