Lines Matching defs:dh
122 # include <openssl/dh.h>
153 DH *dh = NULL;
322 dh = DSA_dup_DH(dsa);
324 if (dh == NULL) {
331 dh = DH_new();
336 if (!dh || !DH_generate_parameters_ex(dh, num, g, &cb)) {
378 dh = DSA_dup_DH(dsa);
380 if (dh == NULL) {
388 dh = d2i_DHparams_bio(in, NULL);
390 dh = PEM_read_bio_DHparams(in, NULL, NULL, NULL);
392 if (dh == NULL) {
399 /* dh != NULL */
423 DHparams_print(out, dh);
427 if (!DH_check(dh, &i)) {
446 len = BN_num_bytes(dh->p);
447 bits = BN_num_bits(dh->p);
454 "#include <openssl/dh.h>\n" "#endif\n");
457 l = BN_bn2bin(dh->p, data);
458 printf("\tstatic unsigned char dh%d_p[]={", bits);
466 l = BN_bn2bin(dh->g, data);
467 printf("\tstatic unsigned char dh%d_g[]={", bits);
475 printf("\tDH *dh;\n\n");
476 printf("\tif ((dh=DH_new()) == NULL) return(NULL);\n");
477 printf("\tdh->p=BN_bin2bn(dh%d_p,sizeof(dh%d_p),NULL);\n",
479 printf("\tdh->g=BN_bin2bn(dh%d_g,sizeof(dh%d_g),NULL);\n",
481 printf("\tif ((dh->p == NULL) || (dh->g == NULL))\n");
482 printf("\t\t{ DH_free(dh); return(NULL); }\n");
483 if (dh->length)
484 printf("\tdh->length = %ld;\n", dh->length);
485 printf("\treturn(dh);\n\t}\n");
491 i = i2d_DHparams_bio(out, dh);
493 i = PEM_write_bio_DHparams(out, dh);
510 if (dh != NULL)
511 DH_free(dh);