summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralexei.volkov.bugs%sun.com <devnull@localhost>2007-06-07 18:18:45 +0000
committeralexei.volkov.bugs%sun.com <devnull@localhost>2007-06-07 18:18:45 +0000
commit717d7c2166ed066b212231310b0db616e26e483c (patch)
tree22c60069a0d0a3c455994b50fa6660099e3f6070
parentbec26c4214a9013ab9f2a25cc381ad3b0d3b05e9 (diff)
downloadnss-hg-717d7c2166ed066b212231310b0db616e26e483c.tar.gz
382078 - pkix default http client returns error when try to get an ocsp response. r=nelson
-rw-r--r--security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpdefaultclient.c23
-rwxr-xr-xsecurity/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_lifecycle.c2
2 files changed, 17 insertions, 8 deletions
diff --git a/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpdefaultclient.c b/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpdefaultclient.c
index d759e816b..a1a222a23 100644
--- a/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpdefaultclient.c
+++ b/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpdefaultclient.c
@@ -1417,7 +1417,8 @@ pkix_pl_HttpDefaultClient_TrySendAndReceive(
PKIX_ENTER
(HTTPDEFAULTCLIENT,
"pkix_pl_HttpDefaultClient_TrySendAndReceive");
- PKIX_NULLCHECK_TWO(request, pPollDesc);
+
+ PKIX_NULLCHECK_ONE(request);
PKIX_CHECK(pkix_CheckType
((PKIX_PL_Object *)request,
@@ -1427,7 +1428,13 @@ pkix_pl_HttpDefaultClient_TrySendAndReceive(
client = (PKIX_PL_HttpDefaultClient *)request;
- pollDesc = *pPollDesc;
+ if (!pPollDesc && client->timeout == 0) {
+ PKIX_ERROR_FATAL(PKIX_NULLARGUMENT);
+ }
+
+ if (pPollDesc) {
+ pollDesc = *pPollDesc;
+ }
/* if not continuing from an earlier WOULDBLOCK return... */
if (pollDesc == NULL) {
@@ -1521,7 +1528,7 @@ pkix_pl_HttpDefaultClient_TrySendAndReceive(
case HTTP_SEND_PENDING:
case HTTP_RECV_HDR_PENDING:
case HTTP_RECV_BODY_PENDING:
- *pPollDesc = &(client->pollDesc);
+ pollDesc = &(client->pollDesc);
*pSECReturn = SECWouldBlock;
break;
case HTTP_ERROR:
@@ -1539,7 +1546,7 @@ pkix_pl_HttpDefaultClient_TrySendAndReceive(
}
}
- *pPollDesc = NULL;
+ pollDesc = NULL;
*pSECReturn = SECFailure;
break;
case HTTP_COMPLETE:
@@ -1552,7 +1559,7 @@ pkix_pl_HttpDefaultClient_TrySendAndReceive(
if (client->rcv_http_data != NULL) {
*(client->rcv_http_data) = client->rcvBuf;
}
- *pPollDesc = NULL;
+ pollDesc = NULL;
*pSECReturn = SECSuccess;
break;
case HTTP_NOT_CONNECTED:
@@ -1560,12 +1567,16 @@ pkix_pl_HttpDefaultClient_TrySendAndReceive(
case HTTP_RECV_HDR:
case HTTP_RECV_BODY:
default:
- *pPollDesc = NULL;
+ pollDesc = NULL;
*pSECReturn = SECFailure;
PKIX_ERROR(PKIX_HTTPCLIENTININVALIDSTATE);
break;
}
+ if (pPollDesc) {
+ *pPollDesc = pollDesc;
+ }
+
cleanup:
PKIX_RETURN(HTTPDEFAULTCLIENT);
diff --git a/security/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_lifecycle.c b/security/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_lifecycle.c
index 2b9ab08a0..4a758880c 100755
--- a/security/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_lifecycle.c
+++ b/security/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_lifecycle.c
@@ -237,9 +237,7 @@ PKIX_PL_Initialize(
pkix_OcspChecker_RegisterSelf(plContext);
pkix_pl_OcspRequest_RegisterSelf(plContext);
pkix_pl_OcspResponse_RegisterSelf(plContext);
-#ifdef BUG_382078_IS_RESOVED
pkix_pl_HttpDefaultClient_RegisterSelf(plContext);
-#endif
pkix_VerifyNode_RegisterSelf(plContext);
PKIX_CHECK(PKIX_PL_NssContext_Create