diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2020-07-10 12:30:38 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-08-18 08:58:19 +0200 |
commit | 8b3b5ae5bebc045e241108b32751f976feae7ecb (patch) | |
tree | 338a9d0a07239e15e0486f2cf2f3b3b9b8175e14 | |
parent | 7257793fc4ec5c40c193ca12b5747a4f49c6f4fe (diff) | |
download | nextcloud-server-8b3b5ae5bebc045e241108b32751f976feae7ecb.tar.gz nextcloud-server-8b3b5ae5bebc045e241108b32751f976feae7ecb.zip |
Add stubs for phpseclib
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
-rw-r--r-- | build/stubs/sftp.php | 83 | ||||
-rw-r--r-- | build/stubs/ssh2.php | 69 | ||||
-rw-r--r-- | psalm.xml | 5 |
3 files changed, 156 insertions, 1 deletions
diff --git a/build/stubs/sftp.php b/build/stubs/sftp.php new file mode 100644 index 00000000000..77b9a7c93b7 --- /dev/null +++ b/build/stubs/sftp.php @@ -0,0 +1,83 @@ +<?php + +define('NET_SFTP_INIT', 1); +define('NET_SFTP_VERSION', 2); +define('NET_SFTP_OPEN', 3); +define('NET_SFTP_CLOSE', 4); +define('NET_SFTP_READ', 5); +define('NET_SFTP_WRITE', 6); +define('NET_SFTP_LSTAT', 7); +define('NET_SFTP_SETSTAT', 9); +define('NET_SFTP_OPENDIR', 11); +define('NET_SFTP_READDIR', 12); +define('NET_SFTP_REMOVE', 13); +define('NET_SFTP_MKDIR', 14); +define('NET_SFTP_RMDIR', 15); +define('NET_SFTP_REALPATH', 16); +define('NET_SFTP_STAT', 17); +define('NET_SFTP_RENAME', 18); +define('NET_SFTP_READLINK', 19); +define('NET_SFTP_SYMLINK', 20); + +define('NET_SFTP_STATUS', 101); +define('NET_SFTP_HANDLE', 102); +define('NET_SFTP_DATA', 103); +define('NET_SFTP_NAME', 104); +define('NET_SFTP_ATTRS', 105); +define('NET_SFTP_EXTENDED', 200); + +define('NET_SFTP_STATUS_OK', 0); +define('NET_SFTP_STATUS_EOF', 1); +define('NET_SFTP_STATUS_NO_SUCH_FILE', 2); +define('NET_SFTP_STATUS_PERMISSION_DENIED', 3); +define('NET_SFTP_STATUS_FAILURE', 4); +define('NET_SFTP_STATUS_BAD_MESSAGE', 5); +define('NET_SFTP_STATUS_NO_CONNECTION', 6); +define('NET_SFTP_STATUS_CONNECTION_LOST', 7); +define('NET_SFTP_STATUS_OP_UNSUPPORTED', 8); +define('NET_SFTP_STATUS_INVALID_HANDLE', 9); +define('NET_SFTP_STATUS_NO_SUCH_PATH', 10); +define('NET_SFTP_STATUS_FILE_ALREADY_EXISTS', 11); +define('NET_SFTP_STATUS_WRITE_PROTECT', 12); +define('NET_SFTP_STATUS_NO_MEDIA', 13); +define('NET_SFTP_STATUS_NO_SPACE_ON_FILESYSTEM', 14); +define('NET_SFTP_STATUS_QUOTA_EXCEEDED', 15); +define('NET_SFTP_STATUS_UNKNOWN_PRINCIPAL', 16); +define('NET_SFTP_STATUS_LOCK_CONFLICT', 17); +define('NET_SFTP_STATUS_DIR_NOT_EMPTY', 18); +define('NET_SFTP_STATUS_NOT_A_DIRECTORY', 19); +define('NET_SFTP_STATUS_INVALID_FILENAME', 20); +define('NET_SFTP_STATUS_LINK_LOOP', 21); +define('NET_SFTP_STATUS_CANNOT_DELETE', 22); +define('NET_SFTP_STATUS_INVALID_PARAMETER', 23); +define('NET_SFTP_STATUS_FILE_IS_A_DIRECTORY', 24); +define('NET_SFTP_STATUS_BYTE_RANGE_LOCK_CONFLICT', 25); +define('NET_SFTP_STATUS_BYTE_RANGE_LOCK_REFUSED', 26); +define('NET_SFTP_STATUS_DELETE_PENDING', 27); +define('NET_SFTP_STATUS_FILE_CORRUPT', 28); +define('NET_SFTP_STATUS_OWNER_INVALID', 29); +define('NET_SFTP_STATUS_GROUP_INVALID', 30); +define('NET_SFTP_STATUS_NO_MATCHING_BYTE_RANGE_LOCK', 31); + +define('NET_SFTP_ATTR_SIZE', 0x00000001); +define('NET_SFTP_ATTR_UIDGID', 0x00000002); +define('NET_SFTP_ATTR_PERMISSIONS', 0x00000004); +define('NET_SFTP_ATTR_ACCESSTIME', 0x00000008); +define('NET_SFTP_ATTR_EXTENDED', (-1 << 31) & 0xFFFFFFFF); + +define('NET_SFTP_OPEN_READ', 0x00000001); +define('NET_SFTP_OPEN_WRITE', 0x00000002); +define('NET_SFTP_OPEN_APPEND', 0x00000004); +define('NET_SFTP_OPEN_CREATE', 0x00000008); +define('NET_SFTP_OPEN_TRUNCATE', 0x00000010); +define('NET_SFTP_OPEN_EXCL', 0x00000020); + +define('NET_SFTP_TYPE_REGULAR', 1); +define('NET_SFTP_TYPE_DIRECTORY', 2); +define('NET_SFTP_TYPE_SYMLINK', 3); +define('NET_SFTP_TYPE_SPECIAL', 4); +define('NET_SFTP_TYPE_UNKNOWN', 5); +define('NET_SFTP_TYPE_SOCKET', 6); +define('NET_SFTP_TYPE_CHAR_DEVICE', 7); +define('NET_SFTP_TYPE_BLOCK_DEVICE', 8); +define('NET_SFTP_TYPE_FIFO', 9); diff --git a/build/stubs/ssh2.php b/build/stubs/ssh2.php new file mode 100644 index 00000000000..bf1a4fb87a8 --- /dev/null +++ b/build/stubs/ssh2.php @@ -0,0 +1,69 @@ +<?php + +define('NET_SSH2_MSG_DISCONNECT', 1); +define('NET_SSH2_MSG_IGNORE', 2); +define('NET_SSH2_MSG_UNIMPLEMENTED', 3); +define('NET_SSH2_MSG_DEBUG', 4); +define('NET_SSH2_MSG_SERVICE_REQUEST', 5); +define('NET_SSH2_MSG_SERVICE_ACCEPT', 6); +define('NET_SSH2_MSG_KEXINIT', 20); +define('NET_SSH2_MSG_NEWKEYS', 21); +define('NET_SSH2_MSG_KEXDH_INIT', 30); +define('NET_SSH2_MSG_KEXDH_REPLY', 31); +define('NET_SSH2_MSG_USERAUTH_REQUEST', 50); +define('NET_SSH2_MSG_USERAUTH_FAILURE', 51); +define('NET_SSH2_MSG_USERAUTH_SUCCESS', 52); +define('NET_SSH2_MSG_USERAUTH_BANNER', 53); + +define('NET_SSH2_MSG_GLOBAL_REQUEST', 80); +define('NET_SSH2_MSG_REQUEST_SUCCESS', 81); +define('NET_SSH2_MSG_REQUEST_FAILURE', 82); +define('NET_SSH2_MSG_CHANNEL_OPEN', 90); +define('NET_SSH2_MSG_CHANNEL_OPEN_CONFIRMATION', 91); +define('NET_SSH2_MSG_CHANNEL_OPEN_FAILURE', 92); +define('NET_SSH2_MSG_CHANNEL_WINDOW_ADJUST', 93); +define('NET_SSH2_MSG_CHANNEL_DATA', 94); +define('NET_SSH2_MSG_CHANNEL_EXTENDED_DATA', 95); +define('NET_SSH2_MSG_CHANNEL_EOF', 96); +define('NET_SSH2_MSG_CHANNEL_CLOSE', 97); +define('NET_SSH2_MSG_CHANNEL_REQUEST', 98); +define('NET_SSH2_MSG_CHANNEL_SUCCESS', 99); +define('NET_SSH2_MSG_CHANNEL_FAILURE', 100); + +define('NET_SSH2_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT', 1); +define('NET_SSH2_DISCONNECT_PROTOCOL_ERROR', 2); +define('NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED', 3); +define('NET_SSH2_DISCONNECT_RESERVED', 4); +define('NET_SSH2_DISCONNECT_MAC_ERROR', 5); +define('NET_SSH2_DISCONNECT_COMPRESSION_ERROR', 6); +define('NET_SSH2_DISCONNECT_SERVICE_NOT_AVAILABLE', 7); +define('NET_SSH2_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED', 8); +define('NET_SSH2_DISCONNECT_HOST_KEY_NOT_VERIFIABLE', 9); +define('NET_SSH2_DISCONNECT_CONNECTION_LOST', 10); +define('NET_SSH2_DISCONNECT_BY_APPLICATION', 11); +define('NET_SSH2_DISCONNECT_TOO_MANY_CONNECTIONS', 12); +define('NET_SSH2_DISCONNECT_AUTH_CANCELLED_BY_USER', 13); +define('NET_SSH2_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE', 14); +define('NET_SSH2_DISCONNECT_ILLEGAL_USER_NAME', 15); + +define('NET_SSH2_OPEN_ADMINISTRATIVELY_PROHIBITED', 1); + +define('NET_SSH2_TTY_OP_END', 0); + +define('NET_SSH2_EXTENDED_DATA_STDERR', 1); + +define('NET_SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ', 60); + +define('NET_SSH2_MSG_USERAUTH_PK_OK', 60); + +define('NET_SSH2_MSG_USERAUTH_INFO_REQUEST', 60); +define('NET_SSH2_MSG_USERAUTH_INFO_RESPONSE', 61); + +define('NET_SSH2_MSG_KEXDH_GEX_REQUEST_OLD', 30); +define('NET_SSH2_MSG_KEXDH_GEX_GROUP', 31); +define('NET_SSH2_MSG_KEXDH_GEX_INIT', 32); +define('NET_SSH2_MSG_KEXDH_GEX_REPLY', 33); +define('NET_SSH2_MSG_KEXDH_GEX_REQUEST', 34); + +define('NET_SSH2_MSG_KEX_ECDH_INIT', 30); +define('NET_SSH2_MSG_KEX_ECDH_REPLY', 31); diff --git a/psalm.xml b/psalm.xml index 47825b31648..42c8142cf42 100644 --- a/psalm.xml +++ b/psalm.xml @@ -21,18 +21,21 @@ <ignoreFiles> <directory name="apps/**/composer"/> <directory name="apps/**/tests"/> + <directory name="apps/files_external/3rdparty"/> <directory name="lib/composer"/> <directory name="lib/l10n"/> </ignoreFiles> </projectFiles> <extraFiles> <directory name="3rdparty"/> + <directory name="apps/files_external/3rdparty"/> </extraFiles> <stubs> <file name="build/stubs/apcu.php"/> <file name="build/stubs/imagick.php"/> <file name="build/stubs/memcached.php"/> <file name="build/stubs/redis.php"/> - <file name="build/stubs/redis_cluster.php"/> + <file name="build/stubs/sftp.php"/> + <file name="build/stubs/ssh2.php"/> </stubs> </psalm> |