Lines Matching refs:dh

293 #define EVP_PKEY_get0_DH(_pkey) _pkey->pkey.dh  in ZEND_GET_MODULE()
343 static void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) in DH_get0_pqg() argument
345 *p = dh->p; in DH_get0_pqg()
346 *q = dh->q; in DH_get0_pqg()
347 *g = dh->g; in DH_get0_pqg()
350 static int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) in DH_set0_pqg() argument
352 dh->p = p; in DH_set0_pqg()
353 dh->q = q; in DH_set0_pqg()
354 dh->g = g; in DH_set0_pqg()
359 static void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) in DH_get0_key() argument
361 *pub_key = dh->pub_key; in DH_get0_key()
362 *priv_key = dh->priv_key; in DH_get0_key()
365 static int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) in DH_set0_key() argument
367 dh->pub_key = pub_key; in DH_set0_key()
368 dh->priv_key = priv_key; in DH_set0_key()
4137 static bool php_openssl_pkey_init_legacy_dh(DH *dh, zval *data, bool *is_private) in php_openssl_pkey_init_legacy_dh() argument
4144 if (!p || !g || !DH_set0_pqg(dh, p, q, g)) { in php_openssl_pkey_init_legacy_dh()
4152 return DH_set0_key(dh, pub_key, priv_key); in php_openssl_pkey_init_legacy_dh()
4159 return DH_set0_key(dh, pub_key, priv_key); in php_openssl_pkey_init_legacy_dh()
4164 if (!DH_generate_key(dh)) { in php_openssl_pkey_init_legacy_dh()
4256 DH *dh = DH_new(); in php_openssl_pkey_init_dh()
4257 if (!dh) { in php_openssl_pkey_init_dh()
4262 if (!php_openssl_pkey_init_legacy_dh(dh, data, is_private) in php_openssl_pkey_init_dh()
4263 || !EVP_PKEY_assign_DH(pkey, dh)) { in php_openssl_pkey_init_dh()
4266 DH_free(dh); in php_openssl_pkey_init_dh()
5092 DH *dh = EVP_PKEY_get0_DH(pkey); in PHP_FUNCTION() local
5095 if (dh != NULL) { in PHP_FUNCTION()
5099 DH_get0_pqg(dh, &p, &q, &g); in PHP_FUNCTION()
5100 DH_get0_key(dh, &pub_key, &priv_key); in PHP_FUNCTION()
5221 DH *dh = EVP_PKEY_get0_DH(pkey); in php_openssl_dh_compute_key()
5222 if (dh == NULL) { in php_openssl_dh_compute_key()
5227 zend_string *data = zend_string_alloc(DH_size(dh), 0); in php_openssl_dh_compute_key()
5228 int len = DH_compute_key((unsigned char*)ZSTR_VAL(data), pub, dh); in php_openssl_dh_compute_key()