Move point of re-entry for restartable X.509 verification
diff --git a/library/x509_crt.c b/library/x509_crt.c
index c6d310d..72c0473 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
@@ -2275,8 +2275,6 @@
         /* restore derived state */
         cur = &ver_chain->items[ver_chain->len - 1];
         child = cur->crt;
-        flags = &cur->flags;
-
         goto find_parent;
     }
 #endif /* MBEDTLS_ECDSA_C && MBEDTLS_ECP_RESTARTABLE */
@@ -2292,6 +2290,11 @@
         cur->crt = child;
         cur->flags = 0;
         ver_chain->len++;
+
+#if defined(MBEDTLS_ECDSA_C) && defined(MBEDTLS_ECP_RESTARTABLE)
+find_parent:
+#endif
+
         flags = &cur->flags;
 
         /* Check time-validity (all certificates) */
@@ -2319,9 +2322,6 @@
             return( 0 );
         }
 
-#if defined(MBEDTLS_ECDSA_C) && defined(MBEDTLS_ECP_RESTARTABLE)
-find_parent:
-#endif
         /* Look for a parent in trusted CAs or up the chain */
         ret = x509_crt_find_parent( child, trust_ca, &parent,
                                        &parent_is_trusted, &signature_is_good,