X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Ftlscert-openssl.c;h=ed8c0bba7722cb015d9b7e9f1493ee322d852da2;hb=eb00228301d5dd1607130d0a9f73c0cd1eba5db0;hp=690f9508148609b4572c587c02388c9ca4509215;hpb=80fea873648ca2ab2e592999a336c59cf054ab55;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/tlscert-openssl.c b/src/src/tlscert-openssl.c index 690f95081..ed8c0bba7 100644 --- a/src/src/tlscert-openssl.c +++ b/src/src/tlscert-openssl.c @@ -149,7 +149,7 @@ else time_t t = mktime(&tm); /* make the tm self-consistent */ if (mod && Ustrcmp(mod, "int") == 0) /* seconds since epoch */ - s = string_sprintf("%u", t); + s = string_sprintf(TIME_T_FMT, t); else { @@ -300,7 +300,7 @@ return mod ? tls_field_from_dn(cp, mod) : cp; uschar * tls_cert_version(void * cert, uschar * mod) { -return string_sprintf("%d", X509_get_version((X509 *)cert)); +return string_sprintf("%ld", X509_get_version((X509 *)cert)); } uschar * @@ -331,8 +331,7 @@ cp3 = cp2 = store_get(len*3+1); while(len) { - sprintf(CS cp2, "%.2x ", *cp1++); - cp2 += 3; + cp2 += sprintf(CS cp2, "%.2x ", *cp1++); len--; } cp2[-1] = '\0'; @@ -343,7 +342,7 @@ return cp3; uschar * tls_cert_subject_altname(void * cert, uschar * mod) { -uschar * list = NULL; +gstring * list = NULL; STACK_OF(GENERAL_NAME) * san = (STACK_OF(GENERAL_NAME) *) X509_get_ext_d2i((X509 *)cert, NID_subject_alt_name, NULL, NULL); uschar osep = '\n'; @@ -399,7 +398,7 @@ while (sk_GENERAL_NAME_num(san) > 0) } sk_GENERAL_NAME_free(san); -return list; +return string_from_gstring(list); } uschar * @@ -410,7 +409,7 @@ STACK_OF(ACCESS_DESCRIPTION) * ads = (STACK_OF(ACCESS_DESCRIPTION) *) int adsnum = sk_ACCESS_DESCRIPTION_num(ads); int i; uschar sep = '\n'; -uschar * list = NULL; +gstring * list = NULL; if (mod) if (*mod == '>' && *++mod) sep = *mod++; @@ -420,14 +419,12 @@ for (i = 0; i < adsnum; i++) ACCESS_DESCRIPTION * ad = sk_ACCESS_DESCRIPTION_value(ads, i); if (ad && OBJ_obj2nid(ad->method) == NID_ad_OCSP) - { - uschar * ele = ASN1_STRING_data(ad->location->d.ia5); - int len = ASN1_STRING_length(ad->location->d.ia5); - list = string_append_listele_n(list, sep, ele, len); - } + list = string_append_listele_n(list, sep, + ASN1_STRING_data(ad->location->d.ia5), + ASN1_STRING_length(ad->location->d.ia5)); } sk_ACCESS_DESCRIPTION_free(ads); -return list; +return string_from_gstring(list); } uschar * @@ -440,7 +437,7 @@ DIST_POINT * dp; int dpsnum = sk_DIST_POINT_num(dps); int i; uschar sep = '\n'; -uschar * list = NULL; +gstring * list = NULL; if (mod) if (*mod == '>' && *++mod) sep = *mod++; @@ -457,14 +454,12 @@ if (dps) for (i = 0; i < dpsnum; i++) if ( (np = sk_GENERAL_NAME_value(names, j)) && np->type == GEN_URI ) - { - uschar * ele = ASN1_STRING_data(np->d.uniformResourceIdentifier); - int len = ASN1_STRING_length(np->d.uniformResourceIdentifier); - list = string_append_listele_n(list, sep, ele, len); - } + list = string_append_listele_n(list, sep, + ASN1_STRING_data(np->d.uniformResourceIdentifier), + ASN1_STRING_length(np->d.uniformResourceIdentifier)); } sk_DIST_POINT_free(dps); -return list; +return string_from_gstring(list); }