Project

General

Profile

« Previous | Next » 

Revision 5ce9bcf5

Added by Jim Pingle over 8 years ago

Fix display of openssl errors when working with CA or certificate entries. Found this while looking into ticket #7370

View differences:

src/usr/local/www/system_camanager.php
274 274
					$dn['organizationalUnitName'] = $pconfig['dn_organizationalunit'];
275 275
				}
276 276
				if (!ca_create($ca, $pconfig['keylen'], $pconfig['lifetime'], $dn, $pconfig['digest_alg'])) {
277
					$input_errors = array();
277 278
					while ($ssl_err = openssl_error_string()) {
278
						$input_errors = array();
279
						array_push($input_errors, "openssl library returns: " . $ssl_err);
279
						if (strpos($ssl_err, 'NCONF_get_string:no value') === false) {
280
							array_push($input_errors, "openssl library returns: " . $ssl_err);
281
						}
280 282
					}
281 283
				}
282 284
			} else if ($pconfig['method'] == "intermediate") {
......
291 293
					$dn['organizationalUnitName'] = $pconfig['dn_organizationalunit'];
292 294
				}
293 295
				if (!ca_inter_create($ca, $pconfig['keylen'], $pconfig['lifetime'], $dn, $pconfig['caref'], $pconfig['digest_alg'])) {
296
					$input_errors = array();
294 297
					while ($ssl_err = openssl_error_string()) {
295
						$input_errors = array();
296
						array_push($input_errors, "openssl library returns: " . $ssl_err);
298
						if (strpos($ssl_err, 'NCONF_get_string:no value') === false) {
299
							array_push($input_errors, "openssl library returns: " . $ssl_err);
300
						}
297 301
					}
298 302
				}
299 303
			}
......
308 312

  
309 313
		if (!$input_errors) {
310 314
			write_config();
315
			pfSenseHeader("system_camanager.php");
311 316
		}
312

  
313
		pfSenseHeader("system_camanager.php");
314 317
	}
315 318
}
316 319

  
src/usr/local/www/system_certmanager.php
398 398
					}
399 399

  
400 400
					if (!cert_create($cert, $pconfig['caref'], $pconfig['keylen'], $pconfig['lifetime'], $dn, $pconfig['type'], $pconfig['digest_alg'])) {
401
						$input_errors = array();
401 402
						while ($ssl_err = openssl_error_string()) {
402
							$input_errors = array();
403
							array_push($input_errors, "openssl library returns: " . $ssl_err);
403
							if (strpos($ssl_err, 'NCONF_get_string:no value') === false) {
404
								array_push($input_errors, "openssl library returns: " . $ssl_err);
405
							}
404 406
						}
405 407
					}
406 408
				}
......
425 427
					}
426 428

  
427 429
					if (!csr_generate($cert, $pconfig['csr_keylen'], $dn, $pconfig['csr_digest_alg'])) {
430
						$input_errors = array();
428 431
						while ($ssl_err = openssl_error_string()) {
429
							$input_errors = array();
430
							array_push($input_errors, "openssl library returns: " . $ssl_err);
432
							if (strpos($ssl_err, 'NCONF_get_string:no value') === false) {
433
								array_push($input_errors, "openssl library returns: " . $ssl_err);
434
							}
431 435
						}
432 436
					}
433 437
				}

Also available in: Unified diff