summaryrefslogtreecommitdiff
path: root/cmd/selfserv
diff options
context:
space:
mode:
authorRobert Relyea <rrelyea@redhat.com>2023-04-12 08:19:35 -0700
committerRobert Relyea <rrelyea@redhat.com>2023-04-12 08:19:35 -0700
commit2386c64d2cf4194c8f63ae2e8d5b9e83544679eb (patch)
treeab0536e1141042e65242d1257534a8ae3f28f6ff /cmd/selfserv
parentaf6cccfbf3d14f62f86e322ea56b4c3a4e3fd5df (diff)
downloadnss-hg-2386c64d2cf4194c8f63ae2e8d5b9e83544679eb.tar.gz
Bug 1806010 FIPS-104-3 requires we restart post programmatically
FIPS -140-3 requires that we give applications a way to restart the Power On Self-Tests programmatically. Unloading the shared library is insufficient. Shutting down softoken and restarting it with a special flag is. This path accomplishes this task by: 1) adding a new startup flag init argument flag called forcePost which is parsed at FC_Initialize time. 2) Code which checks if the post ran properly takes a new Bool which tells the function whether or not to rerun the post operations. If post operations are to be rerun, all test flags are set to unknown or fail and the tests are rerun. The results are returned. 3) Public facing functions to verify integrity looks for a special non-valid character flag as the first character of the filename and uses that to decide if we should rerun post or not. Callers add the flag if post should be rerun. 4) pk11mode, the general FIPS test program makes sure we can turn on the forcePost flag. Differential Revision: https://phabricator.services.mozilla.com/D165050
Diffstat (limited to 'cmd/selfserv')
-rw-r--r--cmd/selfserv/selfserv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/selfserv/selfserv.c b/cmd/selfserv/selfserv.c
index e41bbe3a8..7ad899a77 100644
--- a/cmd/selfserv/selfserv.c
+++ b/cmd/selfserv/selfserv.c
@@ -1532,14 +1532,14 @@ handle_connection(PRFileDesc *tcp_sock, PRFileDesc *model_sock)
}
} else if (reqLen <= 0) { /* hit eof */
snprintf(msgBuf, sizeof(msgBuf), "Get or Post incomplete after %d bytes.\r\n",
- bufDat);
+ bufDat);
iovs[numIOVs].iov_base = msgBuf;
iovs[numIOVs].iov_len = PORT_Strlen(msgBuf);
numIOVs++;
} else if (reqLen < bufDat) {
snprintf(msgBuf, sizeof(msgBuf), "Discarded %d characters.\r\n",
- bufDat - reqLen);
+ bufDat - reqLen);
iovs[numIOVs].iov_base = msgBuf;
iovs[numIOVs].iov_len = PORT_Strlen(msgBuf);