Project

General

Profile

« Previous | Next » 

Revision 1a68f4ba

Added by Steve Beaver over 7 years ago

Mitigate possible vuln in cert manager

View differences:

src/etc/inc/certs.inc
601 601
/* Works for both RSA and ECC (crt) and key (prv) */
602 602
function cert_get_publickey($str_crt, $decode = true, $type = "crt") {
603 603
	if ($decode) {
604
		$str_crt = base64_decode($str_crt);
604
		$str_crt = escapeshellcmd(base64_decode($str_crt));
605 605
	}
606

  
606 607
	switch ($type) {
607 608
		case 'prv':
608 609
			exec("echo \"{$str_crt}\" | openssl pkey -pubout", $out);
......
617 618
			$out = array();
618 619
			break;
619 620
	}
621

  
620 622
	return implode("\n", $out);
621 623
}
622 624

  

Also available in: Unified diff

OSZAR »