Lines Matching refs:len
41 const u8 *buf, size_t len)
46 cert = x509_certificate_parse(buf, len);
85 static const u8 * search_tag(const char *tag, const u8 *buf, size_t len)
90 if (len < plen)
93 for (i = 0; i < len - plen; i++) {
103 const u8 *buf, size_t len)
109 pos = search_tag(pem_cert_begin, buf, len);
113 return tlsv1_add_cert_der(chain, buf, len);
121 end = search_tag(pem_cert_end, pos, buf + len - pos);
145 pos = search_tag(pem_cert_begin, end, buf + len - end);
161 size_t len;
164 buf = (u8 *) os_readfile(cert, &len);
171 ret = tlsv1_add_cert(chain, buf, len);
224 static struct crypto_private_key * tlsv1_set_key_pem(const u8 *key, size_t len)
231 pos = search_tag(pem_key_begin, key, len);
233 pos = search_tag(pem_key2_begin, key, len);
237 end = search_tag(pem_key2_end, pos, key + len - pos);
243 end = search_tag(pem_key_end, pos, key + len - pos);
264 size_t len,
274 pos = search_tag(pem_key_enc_begin, key, len);
278 end = search_tag(pem_key_enc_end, pos, key + len - pos);
292 const u8 *key, size_t len, const char *passwd)
294 cred->key = crypto_private_key_import(key, len, passwd);
296 cred->key = tlsv1_set_key_pem(key, len);
298 cred->key = tlsv1_set_key_enc_pem(key, len, passwd);
333 size_t len;
336 buf = (u8 *) os_readfile(private_key, &len);
343 ret = tlsv1_set_key(cred, buf, len, private_key_passwd);
353 const u8 *dh, size_t len)
359 end = dh + len;
369 if (asn1_get_next(pos, len, &hdr) < 0 ||
431 const u8 *buf, size_t len)
437 pos = search_tag(pem_dhparams_begin, buf, len);
441 return tlsv1_set_dhparams_der(cred, buf, len);
448 end = search_tag(pem_dhparams_end, pos, buf + len - pos);
490 size_t len;
493 buf = (u8 *) os_readfile(dh_file, &len);
500 ret = tlsv1_set_dhparams_blob(cred, buf, len);