summaryrefslogtreecommitdiffstats
path: root/etc/inc/crypt.inc
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-02-26 11:27:52 +0545
committerPhil Davis <phil.davis@inf.org>2015-02-26 11:27:52 +0545
commit1e0b172713a6fd91f0bf63be078fdc6df1b7865a (patch)
tree3a54b1a650eb8ff78a53c1fd7b984b39fd3820b5 /etc/inc/crypt.inc
parent3d16300449b68833a4f37e8675871c0098fe4c5e (diff)
downloadpfsense-1e0b172713a6fd91f0bf63be078fdc6df1b7865a.zip
pfsense-1e0b172713a6fd91f0bf63be078fdc6df1b7865a.tar.gz
Code style guide etc in a to e
Diffstat (limited to 'etc/inc/crypt.inc')
-rw-r--r--etc/inc/crypt.inc53
1 files changed, 27 insertions, 26 deletions
diff --git a/etc/inc/crypt.inc b/etc/inc/crypt.inc
index 225d3b0..8d96b26 100644
--- a/etc/inc/crypt.inc
+++ b/etc/inc/crypt.inc
@@ -2,29 +2,29 @@
/* $Id$ */
/*
- Copyright (C) 2008 Shrew Soft Inc
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
+ Copyright (C) 2008 Shrew Soft Inc
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
pfSense_BUILDER_BINARIES: /usr/bin/openssl
pfSense_MODULE: crypto
@@ -35,9 +35,9 @@
$file = tempnam("/tmp", "php-encrypt");
file_put_contents("{$file}.dec", $val);
exec("/usr/bin/openssl enc {$opt} -aes-256-cbc -in {$file}.dec -out {$file}.enc -k " . escapeshellarg($pass));
- if (file_exists("{$file}.enc"))
+ if (file_exists("{$file}.enc")) {
$result = file_get_contents("{$file}.enc");
- else {
+ } else {
$result = "";
log_error("Failed to encrypt/decrypt data!");
}
@@ -84,8 +84,9 @@
$btag_pos = stripos($in, $btag_val);
$etag_pos = stripos($in, $etag_val);
- if (($btag_pos === false) || ($etag_pos === false))
+ if (($btag_pos === false) || ($etag_pos === false)) {
return false;
+ }
$body_pos = $btag_pos + $btag_len;
$body_len = strlen($in);
OpenPOWER on IntegriCloud