Skip to content

generated openssl functions are broken #504

@smoench

Description

@smoench

(at least on master)

As an example openssl_cipher_key_length return type is marked as void but should return an integer.

Currently:

/**
 * Gets the cipher key length.
 *
 * @param string $cipher_algo The cipher method, see openssl_get_cipher_methods for a list of potential values.
 * @return  Returns the cipher length on success.
 * @throws OpensslException
 *
 */
function openssl_cipher_key_length(string $cipher_algo): void
{
    error_clear_last();
    $safeResult = \openssl_cipher_key_length($cipher_algo);
    if ($safeResult === false) {
        throw OpensslException::createFromPhpError();
    }
}

Expected:

/**
 * Gets the cipher key length.
 *
 * @param string $cipher_algo The cipher method, see openssl_get_cipher_methods for a list of potential values.
 * @return int Returns the cipher length on success.
 * @throws OpensslException
 *
 */
function openssl_cipher_key_length(string $cipher_algo): int
{
    error_clear_last();
    $safeResult = \openssl_cipher_key_length($cipher_algo);
    if ($safeResult === false) {
        throw OpensslException::createFromPhpError();
    }
    return $safeResult;
}

There several more openssl functions with the same issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions