Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

V2.0.x #83

Merged
merged 54 commits into from
Jan 31, 2016
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
7a58b62
WIP
Jan 26, 2016
be79950
Bugs fixed
Jan 26, 2016
de999d3
Verifier updated
Jan 26, 2016
0e1d669
Applied fixes from StyleCI
Jan 26, 2016
45cd5b4
Merge pull request #76 from Spomky-Labs/analysis-ze70m4
Spomky Jan 26, 2016
7f25869
Some tests updated
Jan 26, 2016
78a4ce1
Examples updated
Jan 27, 2016
2559486
Merge remote-tracking branch 'origin/v2.0.x' into v2.0.x
Jan 27, 2016
c248378
Some tests fixed
Jan 27, 2016
59a3d44
Some tests fixed
Jan 27, 2016
b06cabe
All tests fixed
Jan 28, 2016
11273c6
Delete HasPayloadConverter.php
Spomky Jan 28, 2016
f488cd4
Update .scrutinizer.yml
Spomky Jan 28, 2016
c41274c
Applied fixes from StyleCI
Jan 28, 2016
29f8a50
Merge pull request #77 from Spomky-Labs/analysis-8jLDnr
Spomky Jan 28, 2016
f68836f
Update Loader.php
Spomky Jan 28, 2016
ce8a641
Delete z
Spomky Jan 28, 2016
359f30b
Scrutinizer Auto-Fixes
scrutinizer-auto-fixer Jan 28, 2016
fd9dbee
Merge pull request #78 from Spomky-Labs/scrutinizer-patch-1
Spomky Jan 28, 2016
92da15e
Update README.md
Spomky Jan 28, 2016
da4f235
Update Loader.php
Spomky Jan 28, 2016
9318b46
Update Encrypter.php
Spomky Jan 28, 2016
44658cb
Update Signature.php
Spomky Jan 28, 2016
7a364a5
Update Signature.php
Spomky Jan 28, 2016
a302c6a
Update README.md
Spomky Jan 28, 2016
8492207
Applied fixes from StyleCI
Jan 28, 2016
15bc11d
Merge pull request #79 from Spomky-Labs/analysis-zGDgvO
Spomky Jan 28, 2016
beb4293
Update phpunit.xml.dist
Spomky Jan 28, 2016
c7c6d18
Update .scrutinizer.yml
Spomky Jan 28, 2016
6644e2f
Code optimization
Jan 28, 2016
1446f5d
Code optimization
Jan 28, 2016
5740fbc
Code optimization
Jan 28, 2016
b316258
Code optimization
Jan 28, 2016
24925ee
Code optimization
Jan 28, 2016
1498022
Code optimization
Jan 28, 2016
dc4bfae
Code optimization
Jan 28, 2016
f44d095
Update Use.md
Spomky Jan 29, 2016
2b2b8e5
Tests added
Jan 29, 2016
21aa402
StringUtil used
Jan 29, 2016
08a44b9
Update HMAC.php
Spomky Jan 29, 2016
c50b734
Applied fixes from StyleCI
Jan 29, 2016
94c9504
Merge pull request #80 from Spomky-Labs/analysis-z3wGL1
Spomky Jan 29, 2016
c407925
Tests added and bugs fixed
Jan 29, 2016
99e97aa
Examples fixed
Jan 29, 2016
b6acc27
Tests added and example updated
Jan 30, 2016
26bd76c
Tests added
Jan 31, 2016
3729e43
Tests added
Jan 31, 2016
03259ab
Tests added
Jan 31, 2016
ec9700b
Tests added
Jan 31, 2016
ae27d3b
Tests added
Jan 31, 2016
9fa7fea
Applied fixes from StyleCI
Jan 31, 2016
8e74ea6
Merge pull request #82 from Spomky-Labs/analysis-zYj29v
Spomky Jan 31, 2016
23a51c0
Bugs fixed
Jan 31, 2016
6e3adab
Bugs fixed
Jan 31, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/Encrypt1.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion examples/Load1.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion examples/Load2.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion examples/Load3.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion examples/Load4.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion examples/Signature1.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion examples/Signature2.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/ContentEncryption/A128CBCHS256.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/ContentEncryption/A128GCM.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/ContentEncryption/A192CBCHS384.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/ContentEncryption/A192GCM.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/ContentEncryption/A256CBCHS512.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/ContentEncryption/A256GCM.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
14 changes: 7 additions & 7 deletions src/Algorithm/ContentEncryption/AESCBCHS.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand All @@ -12,7 +12,7 @@
namespace Jose\Algorithm\ContentEncryption;

use Jose\Algorithm\ContentEncryptionAlgorithmInterface;
use Jose\Util\StringUtil;

/**
*
*/
Expand All @@ -23,7 +23,7 @@ abstract class AESCBCHS implements ContentEncryptionAlgorithmInterface
*/
public function encryptContent($data, $cek, $iv, $aad, $encoded_protected_header, &$tag)
{
$k = substr($cek, strlen($cek) / 2);
$k = substr($cek, strlen($cek) / 2);

$cyphertext = AESOpenSSL::encrypt($data, $k, $iv);

Expand All @@ -49,7 +49,7 @@ public function decryptContent($data, $cek, $iv, $aad, $encoded_protected_header
return;
}

$k = substr($cek, strlen($cek) / 2);
$k = substr($cek, strlen($cek) / 2);

return AESOpenSSL::decrypt($data, $k, $iv);
}
Expand All @@ -69,8 +69,8 @@ protected function calculateAuthenticationTag($encrypted_data, $cek, $iv, $aad,
if (null !== $aad) {
$calculated_aad .= '.'.$aad;
}
$mac_key = substr($cek, 0, strlen($cek) / 2);
$auth_data_length = strlen($encoded_header);
$mac_key = substr($cek, 0, strlen($cek) / 2);
$auth_data_length = strlen($encoded_header);

$secured_input = implode('', [
$calculated_aad,
Expand All @@ -80,7 +80,7 @@ protected function calculateAuthenticationTag($encrypted_data, $cek, $iv, $aad,
]);
$hash = hash_hmac($this->getHashAlgorithm(), $secured_input, $mac_key, true);

return substr($hash, 0, strlen($hash) / 2);
return substr($hash, 0, strlen($hash) / 2);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/ContentEncryption/AESGCM.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/ContentEncryption/AESInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
3 changes: 1 addition & 2 deletions src/Algorithm/ContentEncryption/AESOpenSSL.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Algorithm\ContentEncryption;
use Jose\Util\StringUtil;

/**
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/ContentEncryptionAlgorithmInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/JWAInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/JWAManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/JWAManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/KeyEncryption/A128GCMKW.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/KeyEncryption/A128KW.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/KeyEncryption/A192GCMKW.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/KeyEncryption/A192KW.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/KeyEncryption/A256GCMKW.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/KeyEncryption/A256KW.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/KeyEncryption/AESGCMKW.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
3 changes: 1 addition & 2 deletions src/Algorithm/KeyEncryption/AESKW.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand All @@ -13,7 +13,6 @@

use Base64Url\Base64Url;
use Jose\Object\JWKInterface;
use Jose\Util\StringUtil;

/**
* Class AESKW.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/KeyEncryption/Dir.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
4 changes: 2 additions & 2 deletions src/Algorithm/KeyEncryption/DirectEncryptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand All @@ -20,7 +20,7 @@
interface DirectEncryptionInterface extends KeyEncryptionAlgorithmInterface
{
/**
* @param \Jose\Object\JWKInterface $key The key used to get the CEK
* @param \Jose\Object\JWKInterface $key The key used to get the CEK
*
* @throws \Exception If key does not support the algorithm or if the key usage does not authorize the operation
*
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/KeyEncryption/ECDHES.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/KeyEncryption/ECDHESA128KW.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/KeyEncryption/ECDHESA192KW.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/KeyEncryption/ECDHESA256KW.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithm/KeyEncryption/ECDHESAESKW.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Spomky-Labs
* Copyright (c) 2014-2016 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand Down
Loading