]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
certtool: store critical extensions even if no other extension are present
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 27 Feb 2017 15:47:55 +0000 (16:47 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 27 Feb 2017 15:57:25 +0000 (16:57 +0100)
That is, fix a bug which prevented critical extensions to be stored
if no other free-form extensions were specified.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
src/certtool-cfg.c

index ae271e10b1c3a5a8a3672aeadc6552759d563e49..7bbab9c423c5f8fe2aa0b0a60d8b0d7e85f791b7 100644 (file)
@@ -1219,7 +1219,7 @@ void get_extensions_crt_set(int type, void *crt)
 
        if (batch) {
                if (!cfg.extensions)
-                       return;
+                       goto check_critical;
                for (i = 0; cfg.extensions[i] != NULL; i += 2) {
                        if (cfg.extensions[i + 1] == NULL) {
                                fprintf(stderr,
@@ -1250,6 +1250,7 @@ void get_extensions_crt_set(int type, void *crt)
                        }
                }
 
+ check_critical:
                if (!cfg.crit_extensions)
                        return;
                for (i = 0; cfg.crit_extensions[i] != NULL; i += 2) {