Home | History | Annotate | Download | only in apps

Lines Matching refs:dh

122 #include <openssl/dh.h>
139 * -dsaparam - read or generate DSA parameters, convert to DH
152 DH *dh=NULL;
249 BIO_printf(bio_err," -dsaparam read or generate DSA parameters, convert to DH\n");
251 BIO_printf(bio_err," -check check the DH parameters\n");
252 BIO_printf(bio_err," -text print a text form of the DH parameters\n");
288 /* DH parameters */
319 dh = DSA_dup_DH(dsa);
321 if (dh == NULL)
330 dh = DH_new();
331 BIO_printf(bio_err,"Generating DH parameters, %d bit long safe prime, generator %d\n",num,g);
333 if(!dh || !DH_generate_parameters_ex(dh, num, g, &cb))
383 dh = DSA_dup_DH(dsa);
385 if (dh == NULL)
395 dh=d2i_DHparams_bio(in,NULL);
397 dh=PEM_read_bio_DHparams(in,NULL,NULL,NULL);
399 if (dh == NULL)
401 BIO_printf(bio_err,"unable to load DH parameters\n");
407 /* dh != NULL */
438 DHparams_print(out,dh);
443 if (!DH_check(dh,&i))
457 printf("DH parameters appear to be ok.\n");
464 len=BN_num_bytes(dh->p);
465 bits=BN_num_bits(dh->p);
473 "#include <openssl/dh.h>\n"
475 printf("DH *get_dh%d()\n\t{\n",bits);
477 l=BN_bn2bin(dh->p,data);
478 printf("\tstatic unsigned char dh%d_p[]={",bits);
486 l=BN_bn2bin(dh->g,data);
487 printf("\tstatic unsigned char dh%d_g[]={",bits);
495 printf("\tDH *dh;\n\n");
496 printf("\tif ((dh=DH_new()) == NULL) return(NULL);\n");
497 printf("\tdh->p=BN_bin2bn(dh%d_p,sizeof(dh%d_p),NULL);\n",
499 printf("\tdh->g=BN_bin2bn(dh%d_g,sizeof(dh%d_g),NULL);\n",
501 printf("\tif ((dh->p == NULL) || (dh->g == NULL))\n");
502 printf("\t\t{ DH_free(dh); return(NULL); }\n");
503 if (dh->length)
504 printf("\tdh->length = %ld;\n", dh->length);
505 printf("\treturn(dh);\n\t}\n");
513 i=i2d_DHparams_bio(out,dh);
515 i=PEM_write_bio_DHparams(out,dh);
522 BIO_printf(bio_err,"unable to write DH parameters\n");
531 if (dh != NULL) DH_free(dh);