Lines Matching refs:pd
55 OSSL_PARAM_BLD_DEF *pd = OPENSSL_zalloc(sizeof(*pd)); in param_push() local
57 if (pd == NULL) in param_push()
59 pd->key = key; in param_push()
60 pd->type = type; in param_push()
61 pd->size = size; in param_push()
62 pd->alloc_blocks = ossl_param_bytes_to_blocks(alloc); in param_push()
63 if ((pd->secure = secure) != 0) in param_push()
64 bld->secure_blocks += pd->alloc_blocks; in param_push()
66 bld->total_blocks += pd->alloc_blocks; in param_push()
67 if (sk_OSSL_PARAM_BLD_DEF_push(bld->params, pd) <= 0) { in param_push()
68 OPENSSL_free(pd); in param_push()
69 pd = NULL; in param_push()
71 return pd; in param_push()
77 OSSL_PARAM_BLD_DEF *pd = param_push(bld, key, size, size, type, 0); in param_push_num() local
79 if (pd == NULL) { in param_push_num()
83 if (size > sizeof(pd->num)) { in param_push_num()
87 memcpy(&pd->num, num, size); in param_push_num()
197 OSSL_PARAM_BLD_DEF *pd; in push_BN() local
226 pd = param_push(bld, key, sz, sz, type, secure); in push_BN()
227 if (pd == NULL) in push_BN()
229 pd->bn = bn; in push_BN()
255 OSSL_PARAM_BLD_DEF *pd; in OSSL_PARAM_BLD_push_utf8_string() local
261 pd = param_push(bld, key, bsize, bsize + 1, OSSL_PARAM_UTF8_STRING, secure); in OSSL_PARAM_BLD_push_utf8_string()
262 if (pd == NULL) in OSSL_PARAM_BLD_push_utf8_string()
264 pd->string = buf; in OSSL_PARAM_BLD_push_utf8_string()
271 OSSL_PARAM_BLD_DEF *pd; in OSSL_PARAM_BLD_push_utf8_ptr() local
275 pd = param_push(bld, key, bsize, sizeof(buf), OSSL_PARAM_UTF8_PTR, 0); in OSSL_PARAM_BLD_push_utf8_ptr()
276 if (pd == NULL) in OSSL_PARAM_BLD_push_utf8_ptr()
278 pd->string = buf; in OSSL_PARAM_BLD_push_utf8_ptr()
285 OSSL_PARAM_BLD_DEF *pd; in OSSL_PARAM_BLD_push_octet_string() local
289 pd = param_push(bld, key, bsize, bsize, OSSL_PARAM_OCTET_STRING, secure); in OSSL_PARAM_BLD_push_octet_string()
290 if (pd == NULL) in OSSL_PARAM_BLD_push_octet_string()
292 pd->string = buf; in OSSL_PARAM_BLD_push_octet_string()
299 OSSL_PARAM_BLD_DEF *pd; in OSSL_PARAM_BLD_push_octet_ptr() local
301 pd = param_push(bld, key, bsize, sizeof(buf), OSSL_PARAM_OCTET_PTR, 0); in OSSL_PARAM_BLD_push_octet_ptr()
302 if (pd == NULL) in OSSL_PARAM_BLD_push_octet_ptr()
304 pd->string = buf; in OSSL_PARAM_BLD_push_octet_ptr()
313 OSSL_PARAM_BLD_DEF *pd; in param_bld_convert() local
317 pd = sk_OSSL_PARAM_BLD_DEF_value(bld->params, i); in param_bld_convert()
318 param[i].key = pd->key; in param_bld_convert()
319 param[i].data_type = pd->type; in param_bld_convert()
320 param[i].data_size = pd->size; in param_bld_convert()
323 if (pd->secure) { in param_bld_convert()
325 secure += pd->alloc_blocks; in param_bld_convert()
328 blk += pd->alloc_blocks; in param_bld_convert()
331 if (pd->bn != NULL) { in param_bld_convert()
333 if (pd->type == OSSL_PARAM_UNSIGNED_INTEGER) in param_bld_convert()
334 BN_bn2nativepad(pd->bn, (unsigned char *)p, pd->size); in param_bld_convert()
336 BN_signed_bn2native(pd->bn, (unsigned char *)p, pd->size); in param_bld_convert()
337 } else if (pd->type == OSSL_PARAM_OCTET_PTR in param_bld_convert()
338 || pd->type == OSSL_PARAM_UTF8_PTR) { in param_bld_convert()
340 *(const void **)p = pd->string; in param_bld_convert()
341 } else if (pd->type == OSSL_PARAM_OCTET_STRING in param_bld_convert()
342 || pd->type == OSSL_PARAM_UTF8_STRING) { in param_bld_convert()
343 if (pd->string != NULL) in param_bld_convert()
344 memcpy(p, pd->string, pd->size); in param_bld_convert()
346 memset(p, 0, pd->size); in param_bld_convert()
347 if (pd->type == OSSL_PARAM_UTF8_STRING) in param_bld_convert()
348 ((char *)p)[pd->size] = '\0'; in param_bld_convert()
351 if (pd->size > sizeof(pd->num)) in param_bld_convert()
352 memset(p, 0, pd->size); in param_bld_convert()
353 else if (pd->size > 0) in param_bld_convert()
354 memcpy(p, &pd->num, pd->size); in param_bld_convert()