Skip to content

Commit

Permalink
Merge pull request #93 from moufmouf/openssl_encrypt
Browse files Browse the repository at this point in the history
openssl_encrypt with no 5th argument is failing
  • Loading branch information
moufmouf authored Mar 7, 2019
2 parents fd18875 + f2ea7fd commit 67b654c
Show file tree
Hide file tree
Showing 10 changed files with 480 additions and 249 deletions.
2 changes: 1 addition & 1 deletion generated/functionsList.php
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,6 @@
'openssl_decrypt',
'openssl_dh_compute_key',
'openssl_digest',
'openssl_encrypt',
'openssl_open',
'openssl_pbkdf2',
'openssl_pkcs12_export_to_file',
Expand Down Expand Up @@ -1078,4 +1077,5 @@
'apc_fetch',
'apcu_fetch',
'preg_replace',
'openssl_encrypt',
];
2 changes: 1 addition & 1 deletion generated/libxml.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Retrieve last error from libxml.
*
* @return object Returns a LibXMLError object if there is any error in the
* @return libXMLError Returns a LibXMLError object if there is any error in the
* buffer, FALSE otherwise.
* @throws LibxmlException
*
Expand Down
29 changes: 0 additions & 29 deletions generated/openssl.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,35 +340,6 @@ function openssl_digest(string $data, string $method, bool $raw_output = false):
}


/**
* Encrypts given data with given method and key, returns a raw
* or base64 encoded string
*
* @param string $data The plaintext message data to be encrypted.
* @param string $method The cipher method. For a list of available cipher methods, use openssl_get_cipher_methods.
* @param string $key The key.
* @param int $options options is a bitwise disjunction of the flags
* OPENSSL_RAW_DATA and
* OPENSSL_ZERO_PADDING.
* @param string $iv A non-NULL Initialization Vector.
* @param string $tag The authentication tag passed by reference when using AEAD cipher mode (GCM or CCM).
* @param string $aad Additional authentication data.
* @param int $tag_length The length of the authentication tag. Its value can be between 4 and 16 for GCM mode.
* @return string Returns the encrypted string on success.
* @throws OpensslException
*
*/
function openssl_encrypt(string $data, string $method, string $key, int $options = 0, string $iv = "", string &$tag = null, string $aad = "", int $tag_length = 16): string
{
error_clear_last();
$result = \openssl_encrypt($data, $method, $key, $options, $iv, $tag, $aad, $tag_length);
if ($result === false) {
throw OpensslException::createFromPhpError();
}
return $result;
}


/**
* openssl_open opens (decrypts)
* sealed_data using the private key associated with
Expand Down
6 changes: 3 additions & 3 deletions generated/shmop.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* shmop_delete is used to delete a shared memory block.
*
* @param int $shmid The shared memory block resource created by
* @param resource $shmid The shared memory block resource created by
* shmop_open
* @throws ShmopException
*
Expand All @@ -25,7 +25,7 @@ function shmop_delete($shmid): void
/**
* shmop_read will read a string from shared memory block.
*
* @param int $shmid The shared memory block identifier created by
* @param resource $shmid The shared memory block identifier created by
* shmop_open
* @param int $start Offset from which to start reading
* @param int $count The number of bytes to read.
Expand All @@ -48,7 +48,7 @@ function shmop_read($shmid, int $start, int $count): string
/**
* shmop_write will write a string into shared memory block.
*
* @param int $shmid The shared memory block identifier created by
* @param resource $shmid The shared memory block identifier created by
* shmop_open
* @param string $data A string to write into shared memory block
* @param int $offset Specifies where to start writing data inside the shared memory
Expand Down
Loading

0 comments on commit 67b654c

Please # to comment.