socsvn commit: r289868 - soc2013/def/crashdump-head/sbin/cryptcore

def at FreeBSD.org def at FreeBSD.org
Tue Aug 18 10:45:30 UTC 2015


Author: def
Date: Tue Aug 18 10:45:28 2015
New Revision: 289868
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=289868

Log:
  Generate a key in the capability mode.

Modified:
  soc2013/def/crashdump-head/sbin/cryptcore/cryptcore.c

Modified: soc2013/def/crashdump-head/sbin/cryptcore/cryptcore.c
==============================================================================
--- soc2013/def/crashdump-head/sbin/cryptcore/cryptcore.c	Tue Aug 18 10:38:18 2015	(r289867)
+++ soc2013/def/crashdump-head/sbin/cryptcore/cryptcore.c	Tue Aug 18 10:45:28 2015	(r289868)
@@ -75,9 +75,19 @@
 	RSA *pubkey;
 	size_t kdssize;
 	int pubkeysize;
+	pid_t pid;
 
 	PJDLOG_ASSERT(pubkeyfile != NULL);
 
+	pid = fork();
+	if (pid == -1) {
+		pjdlog_errno(LOG_ERR, "Unable to create child process");
+		return (false);
+	}
+
+	if (pid > 0)
+		return (wait_for_process(pid) == 0);
+
 	pubkey = RSA_new();
 	if (pubkey == NULL)
 		pjdlog_exitx(1, "Unable to allocate an RSA structure.");
@@ -116,12 +126,12 @@
 	bzero(kds, kdssize);
 	free(kds);
 	RSA_free(pubkey);
-	return (true);
+	exit(0);
 failed:
 	bzero(kds, kdssize);
 	free(kds);
 	RSA_free(pubkey);
-	return (false);
+	exit(1);
 }
 
 static bool


More information about the svn-soc-all mailing list