Lines Matching defs:buf

181 int x509_parse_algorithm_identifier(const u8 *buf, size_t len,
195 if (asn1_get_next(buf, len, &hdr) < 0 ||
203 if (hdr.length > buf + len - hdr.payload)
219 static int x509_parse_public_key(const u8 *buf, size_t len,
233 pos = buf;
234 end = buf + len;
291 int x509_parse_name(const u8 *buf, size_t len, struct x509_name *name,
311 if (asn1_get_next(buf, len, &hdr) < 0 ||
321 if (hdr.length > buf + len - pos)
495 * @buf: Buffer for the string
498 void x509_name_string(struct x509_name *name, char *buf, size_t len)
507 pos = buf;
508 end = buf + len;
519 if (pos > buf + 1 && pos[-1] == ' ' && pos[-2] == ',') {
543 char buf[3];
548 buf[0] = pos[0];
549 buf[1] = pos[1];
550 buf[2] = 0x00;
551 if (sscanf(buf, "%2d", &ret) != 1)
559 char buf[5];
564 buf[0] = pos[0];
565 buf[1] = pos[1];
566 buf[2] = pos[2];
567 buf[3] = pos[3];
568 buf[4] = 0x00;
569 if (sscanf(buf, "%4d", &ret) != 1)
575 int x509_parse_time(const u8 *buf, size_t len, u8 asn1_tag, os_time_t *val)
590 pos = (const char *) buf;
595 if (len != 13 || buf[12] != 'Z') {
597 "UTCTime format", buf, len);
603 "UTCTime year", buf, len);
613 if (len != 15 || buf[14] != 'Z') {
615 "GeneralizedTime format", buf, len);
621 "GeneralizedTime year", buf, len);
635 "(month)", buf, len);
643 "(day)", buf, len);
651 "(hour)", buf, len);
659 "(min)", buf, len);
667 "(sec)", buf, len);
673 buf, len);
692 static int x509_parse_validity(const u8 *buf, size_t len,
711 if (asn1_get_next(buf, len, &hdr) < 0 ||
722 if (plen > (size_t) (buf + len - pos))
978 char buf[80];
984 asn1_oid_to_str(&name->rid, buf, sizeof(buf));
985 wpa_printf(MSG_MSGDUMP, "X509: altName - registeredID: %s", buf);
1201 char buf[80];
1206 os_strlcpy(buf, "anyExtendedKeyUsage", sizeof(buf));
1209 os_strlcpy(buf, "id-kp-serverAuth", sizeof(buf));
1212 os_strlcpy(buf, "id-kp-clientAuth", sizeof(buf));
1215 os_strlcpy(buf, "id-kp-OCSPSigning", sizeof(buf));
1218 asn1_oid_to_str(&oid, buf, sizeof(buf));
1220 wpa_printf(MSG_DEBUG, "ExtKeyUsage KeyPurposeId: %s", buf);
1266 char buf[80];
1318 asn1_oid_to_str(&oid, buf, sizeof(buf));
1320 buf, critical_ext);
1328 buf);
1366 static int x509_parse_tbs_certificate(const u8 *buf, size_t len,
1378 if (asn1_get_next(buf, len, &hdr) < 0 ||
1646 * @buf: Pointer to the X.509 certificate in DER format
1653 struct x509_certificate * x509_certificate_parse(const u8 *buf, size_t len)
1662 os_memcpy(cert + 1, buf, len);
1666 pos = buf;
1667 end = buf + len;
1696 cert->tbs_cert_start = cert->cert_start + (hash_start - buf);
2085 char buf[128];
2095 x509_name_string(&cert->subject, buf, sizeof(buf));
2096 wpa_printf(MSG_DEBUG, "X509: %lu: %s", idx, buf);
2118 x509_name_string(&cert->issuer, buf,
2119 sizeof(buf));
2121 buf);
2122 x509_name_string(&cert->next->subject, buf,
2123 sizeof(buf));
2125 "subject: %s", buf);