• Home
  • Raw
  • Download

Lines Matching refs:p8

81 EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8)  in EVP_PKCS82PKEY()  argument
109 if(p8->pkey->type == V_ASN1_OCTET_STRING) { in EVP_PKCS82PKEY()
110 p8->broken = PKCS8_OK; in EVP_PKCS82PKEY()
111 p = p8->pkey->value.octet_string->data; in EVP_PKCS82PKEY()
112 pkeylen = p8->pkey->value.octet_string->length; in EVP_PKCS82PKEY()
114 p8->broken = PKCS8_NO_OCTET; in EVP_PKCS82PKEY()
115 p = p8->pkey->value.sequence->data; in EVP_PKCS82PKEY()
116 pkeylen = p8->pkey->value.sequence->length; in EVP_PKCS82PKEY()
122 a = p8->pkeyalg; in EVP_PKCS82PKEY()
163 p8->broken = PKCS8_EMBEDDED_PARAM; in EVP_PKCS82PKEY()
166 p8->broken = PKCS8_NS_DB; in EVP_PKCS82PKEY()
183 param = p8->pkeyalg->parameter; in EVP_PKCS82PKEY()
234 param = p8->pkeyalg->parameter; in EVP_PKCS82PKEY()
356 PKCS8_PRIV_KEY_INFO *p8; in EVP_PKEY2PKCS8_broken() local
358 if (!(p8 = PKCS8_PRIV_KEY_INFO_new())) { in EVP_PKEY2PKCS8_broken()
362 p8->broken = broken; in EVP_PKEY2PKCS8_broken()
363 if (!ASN1_INTEGER_set(p8->version, 0)) { in EVP_PKEY2PKCS8_broken()
365 PKCS8_PRIV_KEY_INFO_free (p8); in EVP_PKEY2PKCS8_broken()
368 if (!(p8->pkeyalg->parameter = ASN1_TYPE_new ())) { in EVP_PKEY2PKCS8_broken()
370 PKCS8_PRIV_KEY_INFO_free (p8); in EVP_PKEY2PKCS8_broken()
373 p8->pkey->type = V_ASN1_OCTET_STRING; in EVP_PKEY2PKCS8_broken()
378 if(p8->broken == PKCS8_NO_OCTET) p8->pkey->type = V_ASN1_SEQUENCE; in EVP_PKEY2PKCS8_broken()
380 p8->pkeyalg->algorithm = OBJ_nid2obj(NID_rsaEncryption); in EVP_PKEY2PKCS8_broken()
381 p8->pkeyalg->parameter->type = V_ASN1_NULL; in EVP_PKEY2PKCS8_broken()
383 &p8->pkey->value.octet_string)) { in EVP_PKEY2PKCS8_broken()
385 PKCS8_PRIV_KEY_INFO_free (p8); in EVP_PKEY2PKCS8_broken()
392 if(!dsa_pkey2pkcs8(p8, pkey)) { in EVP_PKEY2PKCS8_broken()
393 PKCS8_PRIV_KEY_INFO_free (p8); in EVP_PKEY2PKCS8_broken()
401 if (!eckey_pkey2pkcs8(p8, pkey)) in EVP_PKEY2PKCS8_broken()
403 PKCS8_PRIV_KEY_INFO_free(p8); in EVP_PKEY2PKCS8_broken()
410 PKCS8_PRIV_KEY_INFO_free (p8); in EVP_PKEY2PKCS8_broken()
413 RAND_add(p8->pkey->value.octet_string->data, in EVP_PKEY2PKCS8_broken()
414 p8->pkey->value.octet_string->length, 0.0); in EVP_PKEY2PKCS8_broken()
415 return p8; in EVP_PKEY2PKCS8_broken()
418 PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken) in PKCS8_set_broken() argument
423 p8->broken = PKCS8_OK; in PKCS8_set_broken()
424 return p8; in PKCS8_set_broken()
428 p8->broken = PKCS8_NO_OCTET; in PKCS8_set_broken()
429 p8->pkey->type = V_ASN1_SEQUENCE; in PKCS8_set_broken()
430 return p8; in PKCS8_set_broken()
440 static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey) in dsa_pkey2pkcs8() argument
449 p8->pkeyalg->algorithm = OBJ_nid2obj(NID_dsa); in dsa_pkey2pkcs8()
473 switch(p8->broken) { in dsa_pkey2pkcs8()
479 &p8->pkey->value.octet_string)) { in dsa_pkey2pkcs8()
486 p8->pkeyalg->parameter->value.sequence = params; in dsa_pkey2pkcs8()
488 p8->pkeyalg->parameter->type = V_ASN1_SEQUENCE; in dsa_pkey2pkcs8()
494 p8->pkeyalg->parameter->value.sequence = params; in dsa_pkey2pkcs8()
496 p8->pkeyalg->parameter->type = V_ASN1_SEQUENCE; in dsa_pkey2pkcs8()
529 if (!(p8->pkey->value.octet_string = ASN1_OCTET_STRING_new())) { in dsa_pkey2pkcs8()
535 &p8->pkey->value.octet_string->data, in dsa_pkey2pkcs8()
536 &p8->pkey->value.octet_string->length)) { in dsa_pkey2pkcs8()
546 p8->pkeyalg->parameter->type = V_ASN1_NULL; in dsa_pkey2pkcs8()
576 if (!(p8->pkey->value.octet_string = ASN1_OCTET_STRING_new())) { in dsa_pkey2pkcs8()
582 &p8->pkey->value.octet_string->data, in dsa_pkey2pkcs8()
583 &p8->pkey->value.octet_string->length)) { in dsa_pkey2pkcs8()
603 static int eckey_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey) in eckey_pkey2pkcs8() argument
619 if (p8->pkeyalg->algorithm) in eckey_pkey2pkcs8()
620 ASN1_OBJECT_free(p8->pkeyalg->algorithm); in eckey_pkey2pkcs8()
622 p8->pkeyalg->algorithm = OBJ_nid2obj(NID_X9_62_id_ecPublicKey); in eckey_pkey2pkcs8()
626 if (p8->pkeyalg->parameter) in eckey_pkey2pkcs8()
628 ASN1_TYPE_free(p8->pkeyalg->parameter); in eckey_pkey2pkcs8()
629 p8->pkeyalg->parameter = NULL; in eckey_pkey2pkcs8()
632 if ((p8->pkeyalg->parameter = ASN1_TYPE_new()) == NULL) in eckey_pkey2pkcs8()
642 p8->pkeyalg->parameter->type = V_ASN1_OBJECT; in eckey_pkey2pkcs8()
643 p8->pkeyalg->parameter->value.object = OBJ_nid2obj(nid); in eckey_pkey2pkcs8()
664 p8->pkeyalg->parameter->type = V_ASN1_SEQUENCE; in eckey_pkey2pkcs8()
665 if ((p8->pkeyalg->parameter->value.sequence in eckey_pkey2pkcs8()
672 ASN1_STRING_set(p8->pkeyalg->parameter->value.sequence, p, i); in eckey_pkey2pkcs8()
708 switch(p8->broken) { in eckey_pkey2pkcs8()
711 p8->pkey->value.octet_string = ASN1_OCTET_STRING_new(); in eckey_pkey2pkcs8()
712 if (!p8->pkey->value.octet_string || in eckey_pkey2pkcs8()
713 !M_ASN1_OCTET_STRING_set(p8->pkey->value.octet_string, in eckey_pkey2pkcs8()