From 813dbf2f590ee2353237eb82b2822eac6bb886e4 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sun, 16 Sep 2012 21:41:50 +0200 Subject: [PATCH] avoid duplicate asn1 structure initialization. --- lib/x509/x509.c | 4 +++- lib/x509/x509_int.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/x509/x509.c b/lib/x509/x509.c index 498eb05d5..61c85983f 100644 --- a/lib/x509/x509.c +++ b/lib/x509/x509.c @@ -206,7 +206,7 @@ gnutls_x509_crt_import (gnutls_x509_crt_t cert, need_free = 1; } - if (cert->cert) + if (cert->expanded) { /* Any earlier asn1_der_decoding will modify the ASN.1 structure, so we need to replace it with a fresh @@ -230,6 +230,8 @@ gnutls_x509_crt_import (gnutls_x509_crt_t cert, gnutls_assert (); goto cleanup; } + + cert->expanded = 1; /* Since we do not want to disable any extension */ diff --git a/lib/x509/x509_int.h b/lib/x509/x509_int.h index 1173f9581..95aa3a30f 100644 --- a/lib/x509/x509_int.h +++ b/lib/x509/x509_int.h @@ -50,6 +50,7 @@ typedef struct gnutls_x509_crt_int { ASN1_TYPE cert; int use_extensions; + int expanded; /* a certificate has been expanded */ } gnutls_x509_crt_int; typedef struct gnutls_x509_crq_int -- 2.11.4.GIT