Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "comodojo/rpcserver",
"name": "pmarcelli/rpcserver",
"description": "Extensible XML and JSON(2.0) RPC server",
"license": "MIT",
"type": "library",
Expand Down Expand Up @@ -27,12 +27,11 @@
"Comodojo\\RpcServer\\": "src/Comodojo/RpcServer"
}
},
"minimum-stability": "dev",
"require": {
"php": ">=5.6.0",
"comodojo/xmlrpc": "dev-master",
"comodojo/foundation": "dev-master",
"phpseclib/phpseclib": "^2.0"
"pmarcelli/xmlrpc": "dev-xmlrpc_u7320",
"pmarcelli/foundation": "dev-foundation_u7320",
"phpseclib/phpseclib": "^3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0|^5.0",
Expand Down
9 changes: 5 additions & 4 deletions src/Comodojo/RpcServer/RpcServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use \Comodojo\Foundation\Logging\Manager as LogManager;
use \Comodojo\Xmlrpc\XmlrpcEncoder;
use \Comodojo\Xmlrpc\XmlrpcDecoder;
use \phpseclib\Crypt\AES;
use phpseclib3\Crypt\AES;
use \Psr\Log\LoggerInterface;
use \Comodojo\Exception\RpcException;
use \Comodojo\Exception\XmlrpcException;
Expand Down Expand Up @@ -81,7 +81,8 @@ class RpcServer {

/**
* Encryption key, in case of encrypted transport
*
* AES key
* Only keys of sizes 16, 24 or 32 supported
* @var string
*/
private $encrypt;
Expand Down Expand Up @@ -395,7 +396,7 @@ private function uncan($payload) {

$this->request_is_encrypted = true;

$aes = new AES();
$aes = new AES('ecb');

$aes->setKey($this->encrypt);

Expand Down Expand Up @@ -498,7 +499,7 @@ private function can($response, $error) {

if ( $this->request_is_encrypted /* && !empty($encoded) */ ) {

$aes = new AES();
$aes = new AES('ecb');

$aes->setKey($this->encrypt);

Expand Down
9 changes: 5 additions & 4 deletions tests/RpcServer/XmlRpcEncryptedTransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
use \Comodojo\Xmlrpc\XmlrpcEncoder;
use \Comodojo\Xmlrpc\XmlrpcDecoder;
use \Comodojo\RpcServer\RpcServer;
use \phpseclib\Crypt\AES;
use phpseclib3\Crypt\AES;

class XmlRpcEncryptedTransportTest extends \PHPUnit_Framework_TestCase {

protected $key = "solongandthanksforallthefish";
//Only keys of sizes 16, 24 or 32 supported
protected $key = "solongandthanksforallthefishxxxx";

protected function encodeRequest($method, $parameters) {

$encoder = new XmlrpcEncoder();

$data = $encoder->encodeCall($method, $parameters);

$aes = new AES();
$aes = new AES('ecb');

$aes->setKey($this->key);

Expand All @@ -25,7 +26,7 @@ protected function encodeRequest($method, $parameters) {

protected function decodeResponse($received) {

$aes = new AES();
$aes = new AES('ecb');

$aes->setKey($this->key);

Expand Down