Lines Matching refs:dh

288 #define EVP_PKEY_get0_DH(_pkey) _pkey->pkey.dh  in ZEND_GET_MODULE()
338 static void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) in DH_get0_pqg() argument
340 *p = dh->p; in DH_get0_pqg()
341 *q = dh->q; in DH_get0_pqg()
342 *g = dh->g; in DH_get0_pqg()
345 static int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) in DH_set0_pqg() argument
347 dh->p = p; in DH_set0_pqg()
348 dh->q = q; in DH_set0_pqg()
349 dh->g = g; in DH_set0_pqg()
354 static void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) in DH_get0_key() argument
356 *pub_key = dh->pub_key; in DH_get0_key()
357 *priv_key = dh->priv_key; in DH_get0_key()
360 static int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) in DH_set0_key() argument
362 dh->pub_key = pub_key; in DH_set0_key()
363 dh->priv_key = priv_key; in DH_set0_key()
4095 static bool php_openssl_pkey_init_legacy_dh(DH *dh, zval *data, bool *is_private) in php_openssl_pkey_init_legacy_dh() argument
4102 if (!p || !g || !DH_set0_pqg(dh, p, q, g)) { in php_openssl_pkey_init_legacy_dh()
4110 return DH_set0_key(dh, pub_key, priv_key); in php_openssl_pkey_init_legacy_dh()
4117 return DH_set0_key(dh, pub_key, priv_key); in php_openssl_pkey_init_legacy_dh()
4122 if (!DH_generate_key(dh)) { in php_openssl_pkey_init_legacy_dh()
4214 DH *dh = DH_new(); in php_openssl_pkey_init_dh()
4215 if (!dh) { in php_openssl_pkey_init_dh()
4220 if (!php_openssl_pkey_init_legacy_dh(dh, data, is_private) in php_openssl_pkey_init_dh()
4221 || !EVP_PKEY_assign_DH(pkey, dh)) { in php_openssl_pkey_init_dh()
4224 DH_free(dh); in php_openssl_pkey_init_dh()
4888 DH *dh = EVP_PKEY_get0_DH(pkey); in PHP_FUNCTION() local
4891 if (dh != NULL) { in PHP_FUNCTION()
4895 DH_get0_pqg(dh, &p, &q, &g); in PHP_FUNCTION()
4896 DH_get0_key(dh, &pub_key, &priv_key); in PHP_FUNCTION()
5019 DH *dh = EVP_PKEY_get0_DH(pkey); in php_openssl_dh_compute_key()
5020 if (dh == NULL) { in php_openssl_dh_compute_key()
5025 zend_string *data = zend_string_alloc(DH_size(dh), 0); in php_openssl_dh_compute_key()
5026 int len = DH_compute_key((unsigned char*)ZSTR_VAL(data), pub, dh); in php_openssl_dh_compute_key()