ssl/dnssec.c: compilation errors.
authorAndy Polyakov <appro@openssl.org>
Wed, 15 May 2013 18:38:58 +0000 (20:38 +0200)
committerAndy Polyakov <appro@openssl.org>
Wed, 15 May 2013 18:38:58 +0000 (20:38 +0200)
ssl/dnssec.c

index f6c26448cded5ff6144cef83ff1357993331ff77..adbee5d1d29c40774c7f4c209cfe149db56d443c 100644 (file)
@@ -80,7 +80,24 @@ unsigned char *SSL_get_tlsa_record_byname (const char *name,int port,int type)
        char *query=NULL;
        size_t qlen;
 
+#ifndef OPENSSL_NO_LIBUNBOUND
        if (ctx == NULL) return NULL;
+#elif defined(RRSET_VALIDATED)
+       static union {
+               void *p; int (*f)(const char*,unsigned int,unsigned int,unsigned int,struct rrsetinfo **); }
+               p_getrrsetbyname = {NULL};
+       static union {
+               void *p; void (*f)(struct rrsetinfo *); }
+               p_freerrset = {NULL};
+
+       if (p_getrrsetbyname.p==NULL) {
+               if ((p_getrrsetbyname.p = DSO_global_lookup("getrrsetbyname")) == NULL ||
+                   (p_freerrset.p = DSO_global_lookup("freerrset")) == NULL)
+                       p_getrrsetbyname.p = (void*)-1;
+       }
+
+       if (p_getrrsetbyname.p == (void *)-1) return NULL;
+#endif
 
        qlen = 7+5+strlen(name)+1;
        if ((query = OPENSSL_malloc(qlen)) == NULL)
@@ -117,24 +134,9 @@ unsigned char *SSL_get_tlsa_record_byname (const char *name,int port,int type)
        }
        }
 #elif defined(RRSET_VALIDATED)
-       do {
-       static union {
-               void *p; int (*f)(const char*,unsigned int,unsigned int,unsigned int,struct rrsetinfo **); }
-               p_getrrsetbyname = {NULL};
-       static union {
-               void *p; void (*f)(struct rrsetinfo *); }
-               p_freerrset = {NULL};
-
+       {
        struct rrsetinfo *rrset=NULL;
 
-       if (p_getrrsetbyname.p==NULL) {
-               if ((p_getrrsetbyname.p = DSO_global_lookup("getrrsetbyname")) == NULL ||
-                   (p_freerrset.p = DSO_global_lookup("freerrset")) == NULL)
-                       p_getrrsetbyname.p = (void*)-1;
-       }
-
-       if (p_getrrsetbyname.p == (void *)-1) break;
-
        if (p_getrrsetbyname.f(query,1,52,RRSET_VALIDATED,&rrset) == 0 && rrset->rri_nrdatas) {
                ret=(void*)-1;  /* -1 means insecure */
                if ((rrset->rri_flags&RRSET_VALIDATED)) do {
@@ -157,7 +159,7 @@ unsigned char *SSL_get_tlsa_record_byname (const char *name,int port,int type)
                } while (0);    
                p_freerrset.f(rrset);
        }
-       } while (0);
+       }
 #elif defined(_WIN32_NOT_YET)
        {
        PDNS_RECORD rrset;