comparison cinst/mozilla.c @ 399:55cbe0a482ce

merged.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 16 Apr 2014 10:01:02 +0200
parents eab288779e07
children 17e1c8f37d72
comparison
equal deleted inserted replaced
398:9e6a2c2033ed 399:55cbe0a482ce
364 * @param[in] secitemp ponts to an SECItem holding the DER certificate. 364 * @param[in] secitemp ponts to an SECItem holding the DER certificate.
365 * @retruns a string of the from "CN of Subject - O of Subject" 365 * @retruns a string of the from "CN of Subject - O of Subject"
366 */ 366 */
367 static char * 367 static char *
368 nss_cert_name(SECItem *secitemp) 368 nss_cert_name(SECItem *secitemp)
369 { char *cn_str, *o_str, *name; 369 {
370 char *cn_str, *o_str, *name;
370 size_t name_len; 371 size_t name_len;
371 cn_str = x509_parse_subject(secitemp->data, secitemp->len, CERT_OID_CN); 372 cn_str = x509_parse_subject(secitemp->data, secitemp->len, CERT_OID_CN);
372 o_str = x509_parse_subject(secitemp->data, secitemp->len, CERT_OID_O); 373 o_str = x509_parse_subject(secitemp->data, secitemp->len, CERT_OID_O);
373 if (!cn_str || !o_str) 374 if (!cn_str || !o_str)
374 { 375 {
375 DEBUGPRINTF("FATAL: Could not parse certificate!"); 376 DEBUGPRINTF("FATAL: Could not parse certificate!");
377 DEBUGPRINTF("data len: %u \n", secitemp->len);
376 exit(ERR_INVALID_CERT); 378 exit(ERR_INVALID_CERT);
377 } 379 }
378 name_len = strlen(cn_str) + strlen(o_str) + 4; 380 name_len = strlen(cn_str) + strlen(o_str) + 4;
379 name = (char *)xmalloc(name_len); 381 name = (char *)xmalloc(name_len);
380 snprintf(name, name_len, "%s - %s", cn_str, o_str); 382 snprintf(name, name_len, "%s - %s", cn_str, o_str);

http://wald.intevation.org/projects/trustbridge/