Verify that all pkix functions that return SECStatus set NSPR error code

NEW
Assigned to

Status

NSS
Libraries
P2
normal
11 years ago
9 years ago

People

(Reporter: Alexei Volkov, Assigned: Alexei Volkov)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: PKIX SUN_MUST_HAVE)

(Assignee)

Description

11 years ago
In review comments to bug 408434:

3. There are many pkix_pl_ functions (like the following one) that return a 
SECStatus, but do not set any error code (e.g. don't call PORT_SetError).  
How is the caller supposed to know what went wrong if they fail?

> SECStatus
> pkix_pl_HttpDefaultClient_CreateSessionFcn(
>         const char *host,
>         PRUint16 portnum,
>         SEC_HTTP_SERVER_SESSION *pSession)
> {
>         PKIX_Error *err = pkix_pl_HttpDefaultClient_CreateSession
>                 (host, portnum, pSession, plContext);
> 
>-        if (err == NULL) {
>-                return SECSuccess;
>-        } else {
>+        if (err) {
>                 PKIX_PL_Object_DecRef((PKIX_PL_Object *)err, plContext);
>                 return SECFailure;
>         }
>+        return SECSuccess;
> }
(Assignee)

Updated

11 years ago
Whiteboard: PKIX
(Assignee)

Updated

10 years ago
Priority: -- → P2
Summary: Verify that all pkix functions that return SECStatus have a way to pass error code to theirs callers → Verify that all pkix functions that return SECStatus set NSPR error code
Target Milestone: 3.12 → 3.12.1
(Assignee)

Updated

10 years ago
Target Milestone: 3.12.1 → 3.12.2
(Assignee)

Updated

10 years ago
Whiteboard: PKIX → PKIX SUN_MUST_HAVE
Target Milestone: 3.12.2 → 3.12.3
Target Milestone: 3.12.3 → 3.12.5
You need to log in before you can comment on or make changes to this bug.