Blob Blame History Raw
diff -Naur openca-ocspd-1.5.1.orig/src/ocspd_engine.c openca-ocspd-1.5.1.new/src/ocspd_engine.c
--- openca-ocspd-1.5.1.orig/src/ocspd_engine.c	2006-10-13 21:26:35.000000000 +0200
+++ openca-ocspd-1.5.1.new/src/ocspd_engine.c	2008-06-19 18:14:58.000000000 +0200
@@ -213,7 +213,7 @@
 			    syslog( LOG_INFO, "Added '%s' to POST COMMANDS",
 				val->value );
 		} else {
-			syslog( LOG_INFO, "Not Reckognised '%s' option",
+			syslog( LOG_INFO, "Not recognised '%s' option",
 				val->name );
 		}
 	}
diff -Naur openca-ocspd-1.5.1.orig/src/ocsp_response.c openca-ocspd-1.5.1.new/src/ocsp_response.c
--- openca-ocspd-1.5.1.orig/src/ocsp_response.c	2006-10-13 17:05:59.000000000 +0200
+++ openca-ocspd-1.5.1.new/src/ocsp_response.c	2008-06-19 18:40:45.000000000 +0200
@@ -67,7 +67,7 @@
 		if ((ca = ocspd_CA_ENTRY_find( conf, cid )) == NULL) {
 			if (conf->verbose) {
 				syslog( LOG_INFO, 
-				  "request for non reckognized CA [serial %ld]",
+				  "request for non recognized CA [serial %ld]",
 					ASN1_INTEGER_get(serial) );
 			}
 			OCSP_basic_add1_status(bs, cid,
@@ -178,6 +178,9 @@
 
 int ocspd_resp_send_socket(int connfd, OCSP_RESPONSE *resp) {
 	BIO *out = NULL;
+	BIO *mem = NULL;
+	char * cp;
+	int len;
 
 	char http_resp[] =
 		"HTTP/1.0 200 OK\r\n"
@@ -195,12 +198,24 @@
 		return(0);
 	}
 
-	BIO_printf(out, http_resp, i2d_OCSP_RESPONSE(resp, NULL));
-	i2d_OCSP_RESPONSE_bio(out, resp);
-	BIO_flush(out);
+	if((mem = BIO_new(BIO_s_mem())) == NULL ) {
+		syslog(LOG_ERR, "ERROR::memory BIO creation");
+		BIO_free(out);
+		return(0);
+	}
 
+	BIO_printf(mem, http_resp, i2d_OCSP_RESPONSE(resp, NULL));
+	i2d_OCSP_RESPONSE_bio(mem, resp);
+	len = BIO_get_mem_data(mem, &cp);
+
+	if (len < 0)
+		syslog(LOG_ERR, "ERROR::response length %d <= 0", len);
+	else
+		BIO_write(out, cp, len);
+
+	BIO_flush(out);
+	BIO_free(mem);
 	BIO_free(out);
 
 	return 1;
 }
-