note 120074 added to function.openssl-pkey-get-private

From: Date: Sat, 22 Oct 2016 09:48:07 +0000
Subject: note 120074 added to function.openssl-pkey-get-private
Groups: php.notes 
Request: Send a blank email to php-notes+get-206937@lists.php.net to get a copy of this message
Since this function can be used to load a PEM encoded string also, those that are using it relying on user input should be sure to check that the passed data is indeed a PEM encoded string and not a malicious file path. The following should be sufficient. <?PHP $private = trim($_POST['private']); if (strpos($private, '-----') !== 0) return false; ?> ---- Server IP: 72.52.91.14 Probable Submitter: 122.149.209.199 ---- Manual Page -- http://php.net/manual/en/function.openssl-pkey-get-private.php Edit -- https://master.php.net/note/edit/120074 Del: integrated -- https://master.php.net/note/delete/120074/integrated Del: useless -- https://master.php.net/note/delete/120074/useless Del: bad code -- https://master.php.net/note/delete/120074/bad+code Del: spam -- https://master.php.net/note/delete/120074/spam Del: non-english -- https://master.php.net/note/delete/120074/non-english Del: in docs -- https://master.php.net/note/delete/120074/in+docs Del: other reasons-- https://master.php.net/note/delete/120074 Reject -- https://master.php.net/note/reject/120074 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#206937) next »