Lines Matching refs:p

39     const unsigned char *p = *in;  in read_ledword()  local
42 ret = (unsigned int)*p++; in read_ledword()
43 ret |= (unsigned int)*p++ << 8; in read_ledword()
44 ret |= (unsigned int)*p++ << 16; in read_ledword()
45 ret |= (unsigned int)*p++ << 24; in read_ledword()
46 *in = p; in read_ledword()
167 const unsigned char *p = *in; in ossl_do_blob_header() local
172 switch (*p) { in ossl_do_blob_header()
192 p++; in ossl_do_blob_header()
194 if (*p++ != 0x2) { in ossl_do_blob_header()
199 p += 6; in ossl_do_blob_header()
200 *pmagic = read_ledword(&p); in ossl_do_blob_header()
201 *pbitlen = read_ledword(&p); in ossl_do_blob_header()
249 *in = p; in ossl_do_blob_header()
289 const unsigned char *p = *in; in do_b2i_key() local
293 if (ossl_do_blob_header(&p, length, &magic, &bitlen, isdss, ispub) <= 0) { in do_b2i_key()
303 key = ossl_b2i_RSA_after_header(&p, bitlen, *ispub); in do_b2i_key()
306 key = ossl_b2i_DSA_after_header(&p, bitlen, *ispub); in do_b2i_key()
327 const unsigned char *p; in ossl_b2i_bio() local
338 p = hdr_buf; in ossl_b2i_bio()
339 if (ossl_do_blob_header(&p, 16, &magic, &bitlen, &isdss, ispub) <= 0) in ossl_b2i_bio()
350 p = buf; in ossl_b2i_bio()
357 key = ossl_b2i_RSA_after_header(&p, bitlen, *ispub); in ossl_b2i_bio()
360 key = ossl_b2i_DSA_after_header(&p, bitlen, *ispub); in ossl_b2i_bio()
378 const unsigned char *p = *in; in ossl_b2i_DSA_after_header() local
388 if (!read_lebn(&p, nbyte, &pbn)) in ossl_b2i_DSA_after_header()
391 if (!read_lebn(&p, 20, &qbn)) in ossl_b2i_DSA_after_header()
394 if (!read_lebn(&p, nbyte, &gbn)) in ossl_b2i_DSA_after_header()
398 if (!read_lebn(&p, nbyte, &pub_key)) in ossl_b2i_DSA_after_header()
401 if (!read_lebn(&p, 20, &priv_key)) in ossl_b2i_DSA_after_header()
427 *in = p; in ossl_b2i_DSA_after_header()
453 BIGNUM *p = NULL, *q = NULL, *dmp1 = NULL, *dmq1 = NULL, *iqmp = NULL; in ossl_b2i_RSA_after_header() local
469 if (!read_lebn(&pin, hnbyte, &p)) in ossl_b2i_RSA_after_header()
481 if (!RSA_set0_factors(rsa, p, q)) in ossl_b2i_RSA_after_header()
483 p = q = NULL; in ossl_b2i_RSA_after_header()
504 BN_free(p); in ossl_b2i_RSA_after_header()
544 unsigned char *p = *out; in write_ledword() local
546 *p++ = dw & 0xff; in write_ledword()
547 *p++ = (dw >> 8) & 0xff; in write_ledword()
548 *p++ = (dw >> 16) & 0xff; in write_ledword()
549 *p++ = (dw >> 24) & 0xff; in write_ledword()
550 *out = p; in write_ledword()
569 unsigned char *p; in do_i2b() local
590 p = *out; in do_i2b()
592 if ((p = OPENSSL_malloc(outlen)) == NULL) { in do_i2b()
596 *out = p; in do_i2b()
600 *p++ = MS_PUBLICKEYBLOB; in do_i2b()
602 *p++ = MS_PRIVATEKEYBLOB; in do_i2b()
603 *p++ = 0x2; in do_i2b()
604 *p++ = 0; in do_i2b()
605 *p++ = 0; in do_i2b()
606 write_ledword(&p, keyalg); in do_i2b()
607 write_ledword(&p, magic); in do_i2b()
608 write_ledword(&p, bitlen); in do_i2b()
610 write_rsa(&p, EVP_PKEY_get0_RSA(pk), ispub); in do_i2b()
613 write_dsa(&p, EVP_PKEY_get0_DSA(pk), ispub); in do_i2b()
651 const BIGNUM *d, *p, *q, *iqmp, *dmp1, *dmq1; in check_bitlen_rsa() local
661 RSA_get0_factors(rsa, &p, &q); in check_bitlen_rsa()
664 || (BN_num_bytes(p) > hnbyte) in check_bitlen_rsa()
679 const BIGNUM *n, *d, *e, *p, *q, *iqmp, *dmp1, *dmq1; in write_rsa() local
688 RSA_get0_factors(rsa, &p, &q); in write_rsa()
690 write_lebn(out, p, hnbyte); in write_rsa()
702 const BIGNUM *p = NULL, *q = NULL, *g = NULL; in check_bitlen_dsa() local
705 DSA_get0_pqg(dsa, &p, &q, &g); in check_bitlen_dsa()
707 bitlen = BN_num_bits(p); in check_bitlen_dsa()
730 const BIGNUM *p = NULL, *q = NULL, *g = NULL; in write_dsa() local
733 DSA_get0_pqg(dsa, &p, &q, &g); in write_dsa()
735 nbyte = BN_num_bytes(p); in write_dsa()
736 write_lebn(out, p, nbyte); in write_dsa()
764 const unsigned char *p = *in; in ossl_do_PVK_header() local
777 pvk_magic = read_ledword(&p); in ossl_do_PVK_header()
784 p += 4; in ossl_do_PVK_header()
787 */ read_ledword(&p); in ossl_do_PVK_header()
788 is_encrypted = read_ledword(&p); in ossl_do_PVK_header()
789 *psaltlen = read_ledword(&p); in ossl_do_PVK_header()
790 *pkeylen = read_ledword(&p); in ossl_do_PVK_header()
800 *in = p; in ossl_do_PVK_header()
812 OSSL_PARAM params[5], *p = params; in derive_pvk_key() local
822 *p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_SALT, in derive_pvk_key()
824 *p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_PASSWORD, in derive_pvk_key()
826 *p++ = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_DIGEST, SN_sha1, 0); in derive_pvk_key()
827 *p++ = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_PROPERTIES, in derive_pvk_key()
829 *p = OSSL_PARAM_construct_end(); in derive_pvk_key()
843 const unsigned char *p = *in; in do_PVK_body_key() local
875 if (!derive_pvk_key(keybuf, sizeof(keybuf), p, saltlen, in do_PVK_body_key()
878 p += saltlen; in do_PVK_body_key()
880 memcpy(enctmp, p, 8); in do_PVK_body_key()
881 p += 8; in do_PVK_body_key()
892 if (!EVP_DecryptUpdate(cctx, q, &enctmplen, p, inlen)) in do_PVK_body_key()
902 if (!EVP_DecryptUpdate(cctx, q, &enctmplen, p, inlen)) in do_PVK_body_key()
912 p = enctmp; in do_PVK_body_key()
919 key = do_b2i_key(&p, keylen, isdss, ispub); in do_PVK_body_key()
937 const unsigned char *p; in do_PVK_key_bio() local
946 p = pvk_hdr; in do_PVK_key_bio()
948 if (!ossl_do_PVK_header(&p, 24, 0, &saltlen, &keylen)) in do_PVK_key_bio()
954 p = buf; in do_PVK_key_bio()
959 key = do_PVK_body_key(&p, saltlen, keylen, cb, u, isdss, ispub, libctx, propq); in do_PVK_key_bio()
1017 unsigned char *p = NULL, *start = NULL; in i2b_PVK() local
1033 p = *out; in i2b_PVK()
1035 start = p = OPENSSL_malloc(outlen); in i2b_PVK()
1036 if (p == NULL) in i2b_PVK()
1044 write_ledword(&p, MS_PVKMAGIC); in i2b_PVK()
1045 write_ledword(&p, 0); in i2b_PVK()
1047 write_ledword(&p, MS_KEYTYPE_KEYX); in i2b_PVK()
1050 write_ledword(&p, MS_KEYTYPE_SIGN); in i2b_PVK()
1052 write_ledword(&p, enclevel ? 1 : 0); in i2b_PVK()
1053 write_ledword(&p, enclevel ? PVK_SALTLEN : 0); in i2b_PVK()
1054 write_ledword(&p, pklen); in i2b_PVK()
1057 if (RAND_bytes_ex(libctx, p, PVK_SALTLEN, 0) <= 0) in i2b_PVK()
1059 salt = p; in i2b_PVK()
1060 p += PVK_SALTLEN; in i2b_PVK()
1063 do_i2b(&p, pk, 0); in i2b_PVK()
1084 p = salt + PVK_SALTLEN + 8; in i2b_PVK()
1088 if (!EVP_EncryptUpdate(cctx, p, &enctmplen, p, pklen - 8)) in i2b_PVK()
1090 if (!EVP_EncryptFinal_ex(cctx, p + enctmplen, &enctmplen)) in i2b_PVK()