diff --git a/.github/workflows/scripts/compile-matrix.sh b/.github/workflows/scripts/compile-matrix.sh index e9932ed445..ed05b3e1c9 100755 --- a/.github/workflows/scripts/compile-matrix.sh +++ b/.github/workflows/scripts/compile-matrix.sh @@ -190,6 +190,13 @@ console_set "3ds nfs" "-Itools/platform_stubs/ctr $NFSD" "-D_3DS -DARM11 console_set "vita nfs" "-Itools/platform_stubs/vita $NFSD" "-DVITA -DRARCH_CONSOLE -DHAVE_SOCKET_LEGACY" $NFS_SET console_set "switch nfs" "-I$STUBS/libnx $NFSD" "-DHAVE_LIBNX -DSWITCH -D__SWITCH__ -DRARCH_CONSOLE" $NFS_SET console_set "wiiu nfs" "-Iwiiu/include -Itools/platform_stubs/wiiu $NFSD" "-DWIIU -D__WUT__ -DHW_WUP -D__wiiu__ -DRARCH_CONSOLE" $NFS_SET +# The built-in SMB and Kerberos clients, which the 3DS, Vita and Switch +# build on their crypto (the Wii U has no kernel RNG for it to draw on). +SMB_SET="libretro-common/net/net_smb2.c libretro-common/net/net_krb5.c libretro-common/vfs/vfs_implementation_smb.c" +SMBD="-DHAVE_RETROSMB -DHAVE_SMBCLIENT" +console_set "3ds smb" "-Itools/platform_stubs/ctr $SMBD" "-D_3DS -DARM11 -DRARCH_CONSOLE" $SMB_SET +console_set "vita smb" "-Itools/platform_stubs/vita $SMBD" "-DVITA -DRARCH_CONSOLE -DHAVE_SOCKET_LEGACY" $SMB_SET +console_set "switch smb" "-I$STUBS/libnx $SMBD" "-DHAVE_LIBNX -DSWITCH -D__SWITCH__ -DRARCH_CONSOLE" $SMB_SET # Every platform makefile on Makefile.common, without its toolchain: the # graph's own DEFINES checked for consistency (TLS, SMB, NFS need the diff --git a/CHANGES.md b/CHANGES.md index 7088579e48..dd09439396 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -98,6 +98,7 @@ - NETWORK: Built-in NFSv3 and NFSv4 (4.0, 4.1, 4.2) client for loading content from nfs:// exports - NETWORK: NFS files stay usable across a server restart, a dropped connection or a long pause: the client reconnects and reopens what it needs - 3DS/VITA/SWITCH/WIIU: nfs:// content through the built-in NFS client +- 3DS/VITA/SWITCH: smb:// content through the built-in SMB client - NETWORK: SMB files stay usable across a server restart: the connection is mended and the file opened again where it was - NETWORK: NFSv4.2 reads use READ_PLUS: holes in sparse files no longer cross the network - 3DS/SWITCH: nfs:// content through the built-in NFS client diff --git a/Makefile.ctr b/Makefile.ctr index 7d16765d07..3c7a19e7d5 100644 --- a/Makefile.ctr +++ b/Makefile.ctr @@ -106,6 +106,8 @@ else HAVE_RETROSSL = 1 # the built-in NFS client (nfs://); it needs no crypto HAVE_RETRONFS = 1 + # the built-in SMB client (smb://), on the crypto above + HAVE_RETROSMB = 1 HAVE_CORE_INFO_CACHE = 1 HAVE_CLOUDSYNC = 1 diff --git a/Makefile.libnx b/Makefile.libnx index c809d73a3c..72553e0643 100644 --- a/Makefile.libnx +++ b/Makefile.libnx @@ -64,6 +64,8 @@ HAVE_KEYCHAIN = 1 HAVE_RETROSSL = 1 # The built-in NFS client (nfs://); it needs no crypto. HAVE_RETRONFS = 1 +# The built-in SMB client (smb://), on the crypto above. +HAVE_RETROSMB = 1 # RetroArch libnx useful flags HAVE_THREADS = 1 diff --git a/Makefile.vita b/Makefile.vita index 4f9c1a6b0c..4ce77eb906 100644 --- a/Makefile.vita +++ b/Makefile.vita @@ -84,6 +84,8 @@ else HAVE_SOCKET_LEGACY := 1 # the built-in NFS client (nfs://); it needs no crypto HAVE_RETRONFS := 1 + # the built-in SMB client (smb://), on the crypto above + HAVE_RETROSMB := 1 HAVE_MENU := 1 HAVE_MENU_COMMON := 1 HAVE_GFX_WIDGETS := 1 diff --git a/docs/network-stack.md b/docs/network-stack.md index e66f6949d1..e5b3db2968 100644 --- a/docs/network-stack.md +++ b/docs/network-stack.md @@ -65,6 +65,10 @@ other cores have the file copied to local storage first. Changes to these settings apply the next time a share is browsed; content already running keeps its connection. A wired connection is more reliable than Wi-Fi. +Besides the desktop and mobile builds, the 3DS, Vita and Switch carry the +SMB client, on their hardware random number generators. The Wii U does +not: it has no kernel source of randomness for the keys SMB derives. + ## Loading content from NFS exports The NFS client supports NFSv3, which finds the NFS and MOUNT services diff --git a/libretro-common/net/net_smb2.c b/libretro-common/net/net_smb2.c index 866eb865e4..cbaff09904 100644 --- a/libretro-common/net/net_smb2.c +++ b/libretro-common/net/net_smb2.c @@ -78,7 +78,13 @@ * SMB2_LARGE_IO once the server has granted the credits; the * connection's buffers are sized to what it negotiated. */ #define SMB2_MAX_IO (64 * 1024) +/* The 3DS keeps the 64 KiB start: its RAM is small, four connections + * at 1 MiB would hold 8 MiB of buffers, and its Wi-Fi gains nothing. */ +#ifdef _3DS +#define SMB2_LARGE_IO (64 * 1024) +#else #define SMB2_LARGE_IO (1024 * 1024) +#endif #define SMB2_BUF_SIZE(io) (SMB2_TRANSFORM_HDR_SIZE + SMB2_HDR_SIZE + (io) + 4096) #define SMB2_RX_SIZE SMB2_BUF_SIZE(SMB2_MAX_IO)