292
292
void x509_name_string(struct x509_name *name, char *buf, size_t len)
300
pos += snprintf(pos, end - pos, "C=%s, ", name->c);
302
pos += snprintf(pos, end - pos, "ST=%s, ", name->st);
304
pos += snprintf(pos, end - pos, "L=%s, ", name->l);
306
pos += snprintf(pos, end - pos, "O=%s, ", name->o);
308
pos += snprintf(pos, end - pos, "OU=%s, ", name->ou);
310
pos += snprintf(pos, end - pos, "CN=%s, ", name->cn);
304
ret = snprintf(pos, end - pos, "C=%s, ", name->c);
305
if (ret < 0 || ret >= end - pos)
310
ret = snprintf(pos, end - pos, "ST=%s, ", name->st);
311
if (ret < 0 || ret >= end - pos)
316
ret = snprintf(pos, end - pos, "L=%s, ", name->l);
317
if (ret < 0 || ret >= end - pos)
322
ret = snprintf(pos, end - pos, "O=%s, ", name->o);
323
if (ret < 0 || ret >= end - pos)
328
ret = snprintf(pos, end - pos, "OU=%s, ", name->ou);
329
if (ret < 0 || ret >= end - pos)
334
ret = snprintf(pos, end - pos, "CN=%s, ", name->cn);
335
if (ret < 0 || ret >= end - pos)
312
340
if (pos > buf + 1 && pos[-1] == ' ' && pos[-2] == ',') {
317
345
if (name->email) {
318
pos += snprintf(pos, end - pos, "/emailAddress=%s",
346
ret = snprintf(pos, end - pos, "/emailAddress=%s",
348
if (ret < 0 || ret >= end - pos)