Date: Tue, 18 Aug 2015 10:45:29 GMT From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r289868 - soc2013/def/crashdump-head/sbin/cryptcore Message-ID: <201508181045.t7IAjTYh005641@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508181045.t7IAjTYh005641>