summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2002-12-04 23:38:36 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2002-12-04 23:38:36 +0000
commit7fea45a2275167432a5f39c6a1f7dc1d19f8149a (patch)
treeeee8fe330c38f554e0b11feefe9ba4326ea9f6a1
parentd42904459e4ad03575627790d4a14da4f0344824 (diff)
downloadgnutls-7fea45a2275167432a5f39c6a1f7dc1d19f8149a.tar.gz
some optimizations in string handling of the x.509 asn.1 parsers.
-rw-r--r--lib/x509_extensions.c3
-rw-r--r--lib/x509_verify.c12
2 files changed, 5 insertions, 10 deletions
diff --git a/lib/x509_extensions.c b/lib/x509_extensions.c
index babf2ea0d1..3f4638b11f 100644
--- a/lib/x509_extensions.c
+++ b/lib/x509_extensions.c
@@ -306,8 +306,7 @@ int _gnutls_get_extension( const gnutls_datum * cert, const char* extension_id,
do {
k++;
- _gnutls_str_cpy(name, sizeof(name), "certificate2.tbsCertificate.extensions");
- _gnutls_str_cat(name, sizeof(name), ".?");
+ _gnutls_str_cpy(name, sizeof(name), "certificate2.tbsCertificate.extensions.?");
_gnutls_int2str(k, counter);
_gnutls_str_cat(name, sizeof(name), counter);
diff --git a/lib/x509_verify.c b/lib/x509_verify.c
index 71f0772646..fd6e77e54f 100644
--- a/lib/x509_verify.c
+++ b/lib/x509_verify.c
@@ -79,7 +79,6 @@ int compare_dn(gnutls_cert * cert, gnutls_cert * issuer_cert)
ASN1_TYPE c2, c3;
int result, len1;
int len2;
- char tmpstr[512];
int start1, start2, end1, end2;
/* get the issuer of 'cert'
@@ -121,11 +120,9 @@ int compare_dn(gnutls_cert * cert, gnutls_cert * issuer_cert)
}
- _gnutls_str_cpy(tmpstr, sizeof(tmpstr),
- "certificate2.tbsCertificate.issuer");
result =
asn1_der_decoding_startEnd(c2, cert->raw.data, cert->raw.size,
- tmpstr, &start1, &end1);
+ "certificate2.tbsCertificate.issuer", &start1, &end1);
asn1_delete_structure(&c2);
if (result != ASN1_SUCCESS) {
@@ -136,12 +133,11 @@ int compare_dn(gnutls_cert * cert, gnutls_cert * issuer_cert)
len1 = end1 - start1 + 1;
- _gnutls_str_cpy(tmpstr, sizeof(tmpstr),
- "certificate2.tbsCertificate.subject");
result =
asn1_der_decoding_startEnd(c3, issuer_cert->raw.data,
- issuer_cert->raw.size, tmpstr, &start2,
- &end2);
+ issuer_cert->raw.size,
+ "certificate2.tbsCertificate.subject",
+ &start2, &end2);
asn1_delete_structure(&c3);
if (result != ASN1_SUCCESS) {