summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ocsp
diff options
context:
space:
mode:
authordoug <>2014-10-03 06:02:38 +0000
committerdoug <>2014-10-03 06:02:38 +0000
commit079e384e3438a23d2ddc504f4d34e5a46d9dd6e8 (patch)
treeec58ae0912470726cdc0183e7bc10028ba918120 /src/lib/libcrypto/ocsp
parent8b25549254bce5b7fc083b5930f89878aa04174f (diff)
downloadopenbsd-079e384e3438a23d2ddc504f4d34e5a46d9dd6e8.tar.gz
openbsd-079e384e3438a23d2ddc504f4d34e5a46d9dd6e8.tar.bz2
openbsd-079e384e3438a23d2ddc504f4d34e5a46d9dd6e8.zip
Use string literals in printf style calls so gcc's -Wformat works.
ok tedu@, miod@
Diffstat (limited to 'src/lib/libcrypto/ocsp')
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_ht.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/lib/libcrypto/ocsp/ocsp_ht.c b/src/lib/libcrypto/ocsp/ocsp_ht.c
index 5d1627192c..4d21543396 100644
--- a/src/lib/libcrypto/ocsp/ocsp_ht.c
+++ b/src/lib/libcrypto/ocsp/ocsp_ht.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp_ht.c,v 1.21 2014/07/25 06:05:32 doug Exp $ */ 1/* $OpenBSD: ocsp_ht.c,v 1.22 2014/10/03 06:02:38 doug Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -119,11 +119,8 @@ OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx)
119int 119int
120OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req) 120OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req)
121{ 121{
122 static const char req_hdr[] = 122 if (BIO_printf(rctx->mem, "Content-Type: application/ocsp-request\r\n"
123 "Content-Type: application/ocsp-request\r\n" 123 "Content-Length: %d\r\n\r\n", i2d_OCSP_REQUEST(req, NULL)) <= 0)
124 "Content-Length: %d\r\n\r\n";
125
126 if (BIO_printf(rctx->mem, req_hdr, i2d_OCSP_REQUEST(req, NULL)) <= 0)
127 return 0; 124 return 0;
128 if (i2d_OCSP_REQUEST_bio(rctx->mem, req) <= 0) 125 if (i2d_OCSP_REQUEST_bio(rctx->mem, req) <= 0)
129 return 0; 126 return 0;
@@ -154,7 +151,6 @@ OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx, const char *name,
154OCSP_REQ_CTX * 151OCSP_REQ_CTX *
155OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, int maxline) 152OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, int maxline)
156{ 153{
157 static const char post_hdr[] = "POST %s HTTP/1.0\r\n";
158 OCSP_REQ_CTX *rctx; 154 OCSP_REQ_CTX *rctx;
159 155
160 rctx = malloc(sizeof(OCSP_REQ_CTX)); 156 rctx = malloc(sizeof(OCSP_REQ_CTX));
@@ -177,7 +173,7 @@ OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, int maxline)
177 if (!path) 173 if (!path)
178 path = "/"; 174 path = "/";
179 175
180 if (BIO_printf(rctx->mem, post_hdr, path) <= 0) { 176 if (BIO_printf(rctx->mem, "POST %s HTTP/1.0\r\n", path) <= 0) {
181 free(rctx->iobuf); 177 free(rctx->iobuf);
182 BIO_free(rctx->mem); 178 BIO_free(rctx->mem);
183 free(rctx); 179 free(rctx);