Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: holzschu/ios_system
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: blinksh/ios_system
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 13 commits
  • 13 files changed
  • 4 contributors

Commits on Feb 9, 2021

  1. Use relative paths for blink. Explicitly specify symbol visibility, s…

    …o curl_static_main is not stripped
    yury committed Feb 9, 2021
    Copy the full SHA
    d0a21d4 View commit details

Commits on Sep 9, 2021

  1. Use BlinkConfig

    yury committed Sep 9, 2021
    Copy the full SHA
    c321c57 View commit details
  2. Copy the full SHA
    1aa8b51 View commit details

Commits on Oct 5, 2021

  1. Copy the full SHA
    3f8756f View commit details
  2. Try to trigger build

    yury committed Oct 5, 2021
    Copy the full SHA
    c6973b3 View commit details
  3. Copy the full SHA
    a56b915 View commit details

Commits on May 13, 2022

  1. Copy the full SHA
    e641e65 View commit details

Commits on Feb 21, 2023

  1. Rename BKDefaults to BLKDefaults

    yury committed Feb 21, 2023
    Copy the full SHA
    46a8ca0 View commit details

Commits on Jun 5, 2023

  1. update xcframework paths for XCode 14.3

    Mike Bruce committed Jun 5, 2023
    Copy the full SHA
    2203a23 View commit details
  2. Merge pull request #1 from mikepjb/master

    Update xcframework paths for XCode 14.3
    yury authored Jun 5, 2023
    Copy the full SHA
    61f51be View commit details

Commits on Mar 28, 2024

  1. Merge branch 'master' into blink_master

    Carlos Cabanero committed Mar 28, 2024
    Copy the full SHA
    4181c97 View commit details

Commits on Jun 14, 2024

  1. Curl disabling LibSSH2

    - Before we were using a curl_static as a way to use our own version of the
    libraries. We now support sftp through our own commands which are better for
    these scenarios. So we can disable ssh/sftp support.
    - Use the xcframework instead of the old framework to simplify the builds.
    Carlos Cabanero committed Jun 14, 2024
    Copy the full SHA
    38726da View commit details

Commits on Sep 18, 2024

  1. Blink release only

    Carlos Cabanero committed Sep 18, 2024
    Copy the full SHA
    6de0a91 View commit details
185 changes: 93 additions & 92 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -31,58 +31,6 @@ jobs:
draft: false
prerelease: false

- name: Upload ios_error.h
id: upload_ios_error
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ios_error.h
asset_name: ios_error.h
asset_content_type: text/plain

- name: Upload commandDictionary.plist
id: upload_commandDictionary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Resources/commandDictionary.plist
asset_name: commandDictionary.plist
asset_content_type: text/plain

- name: Upload ios_system
id: upload-ios_system
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .build/ios_system.xcframework.zip
asset_name: ios_system.xcframework.zip
asset_content_type: application/zip
- name: Upload awk.xcframework
id: upload-awk
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .build/awk.xcframework.zip
asset_name: awk.xcframework.zip
asset_content_type: application/zip
- name: Upload tar.xcframework
id: upload-tar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .build/tar.xcframework.zip
asset_name: tar.xcframework.zip
asset_content_type: application/zip
- name: Upload curl_ios.xcframework
id: upload-curl_ios
uses: actions/upload-release-asset@v1
@@ -93,43 +41,96 @@ jobs:
asset_path: .build/curl_ios.xcframework.zip
asset_name: curl_ios.xcframework.zip
asset_content_type: application/zip
- name: Upload files.xcframework
id: upload-files
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .build/files.xcframework.zip
asset_name: files.xcframework.zip
asset_content_type: application/zip
- name: Upload shell.xcframework
id: upload-shell
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .build/shell.xcframework.zip
asset_name: shell.xcframework.zip
asset_content_type: application/zip
- name: Upload ssh_cmd.xcframework
id: upload-ssh
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .build/ssh_cmd.xcframework.zip
asset_name: ssh_cmd.xcframework.zip
asset_content_type: application/zip
- name: Upload text.xcframework
id: upload-text
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .build/text.xcframework.zip
asset_name: text.xcframework.zip
asset_content_type: application/zip

# - name: Upload ios_error.h
# id: upload_ios_error
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ios_error.h
# asset_name: ios_error.h
# asset_content_type: text/plain

# - name: Upload commandDictionary.plist
# id: upload_commandDictionary
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./Resources/commandDictionary.plist
# asset_name: commandDictionary.plist
# asset_content_type: text/plain

# - name: Upload ios_system
# id: upload-ios_system
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: .build/ios_system.xcframework.zip
# asset_name: ios_system.xcframework.zip
# asset_content_type: application/zip
# - name: Upload awk.xcframework
# id: upload-awk
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: .build/awk.xcframework.zip
# asset_name: awk.xcframework.zip
# asset_content_type: application/zip
# - name: Upload tar.xcframework
# id: upload-tar
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: .build/tar.xcframework.zip
# asset_name: tar.xcframework.zip
# asset_content_type: application/zip
# - name: Upload files.xcframework
# id: upload-files
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: .build/files.xcframework.zip
# asset_name: files.xcframework.zip
# asset_content_type: application/zip
# - name: Upload shell.xcframework
# id: upload-shell
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: .build/shell.xcframework.zip
# asset_name: shell.xcframework.zip
# asset_content_type: application/zip
# - name: Upload ssh_cmd.xcframework
# id: upload-ssh
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: .build/ssh_cmd.xcframework.zip
# asset_name: ssh_cmd.xcframework.zip
# asset_content_type: application/zip
# - name: Upload text.xcframework
# id: upload-text
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: .build/text.xcframework.zip
# asset_name: text.xcframework.zip
# asset_content_type: application/zip
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# ios_system: Drop-in replacement for system() in iOS programs


<p align="center">
<img src="https://img.shields.io/badge/Platform-iOS%2014.0+-lightgrey.svg" alt="Platform: iOS">
<a href="https://github.com/holzschu/ios_system/actions"><img src="https://github.com/holzschu/ios_system/workflows/CI/badge.svg" alt="Build Status"/></a>
2 changes: 1 addition & 1 deletion curl/config_iphone/curl_config.h
Original file line number Diff line number Diff line change
@@ -389,7 +389,7 @@

/* Define to 1 if you have the `ssh2' library (-lssh2). */
/* #undef HAVE_LIBSSH2 */
#define HAVE_LIBSSH2 1
/* #define HAVE_LIBSSH2 1 */

/* Define to 1 if you have the `ssl' library (-lssl). */
/* #undef HAVE_LIBSSL */
6 changes: 6 additions & 0 deletions curl/curl/lib/url.c
Original file line number Diff line number Diff line change
@@ -120,6 +120,12 @@
#include "dynbuf.h"
#include "headers.h"

// If we have Blinkshell, we use their key management:
#ifdef BLINKSHELL
#import "BLKDefaults.h"
#import <BlinkConfig/BKHosts.h>
#endif

#include <TargetConditionals.h>
#if TARGET_OS_IPHONE
// from ios_error.h, but without the compileError:
58 changes: 58 additions & 0 deletions curl/curl/lib/vssh/libssh2.c
Original file line number Diff line number Diff line change
@@ -28,6 +28,13 @@

#ifdef USE_LIBSSH2

// If we have Blinkshell, we use their key management:
#ifdef BLINKSHELL
#import "BLKDefaults.h"
#import <BlinkConfig/BKHosts.h>
#import <BlinkConfig/BKPubKey.h>
#endif

#include <limits.h>

#include <libssh2/libssh2.h>
@@ -1093,6 +1100,57 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block)
home = curl_getenv("SSH_HOME");
if (!home) home = curl_getenv("HOME");

// iOS secure storing options (key, username, password)
// Find the private key:
// a) if the user specified a private key, use it:
if(data->set.str[STRING_SSH_PRIVATE_KEY])
sshc->rsa = strdup(data->set.str[STRING_SSH_PRIVATE_KEY]); // it's a string
else {
#ifdef BLINKSHELL
// b) if running inside Blinkshell, use their storage options:
if (host) {
if (!sshc->passphrase && host.password) sshc->passphrase = [host.password UTF8String];
// Find the stored key that corresponds to the key name:
publicKeyMemory = NULL; privateKeyMemory = NULL;
if (data->set.str[STRING_SSH_PRIVATE_KEY]) {
// Priority 1: user specified a key name, different from default
// key associated with this hostname
if ((pk = [BKPubKey withID:[NSString stringWithUTF8String:data->set.str[STRING_SSH_PRIVATE_KEY]]]) != nil) {
publicKeyMemory = [pk.publicKey UTF8String];
privateKeyMemory = [[pk loadPrivateKey] UTF8String];
sshc->rsa = data->set.str[STRING_SSH_PRIVATE_KEY];
}
}
if (!(privateKeyMemory && publicKeyMemory)) {
// Priority 2: default key associated with the host
if (host.key) {
if ((pk = [BKPubKey withID:host.key]) != nil) {
publicKeyMemory = [pk.publicKey UTF8String];
privateKeyMemory = [[pk loadPrivateKey] UTF8String];
sshc->rsa = strdup(host.key.UTF8String);
}
}
}

} else {

if (!(privateKeyMemory && publicKeyMemory)) {
// Priority 2: key named id_rsa:
if ((pk = [BKPubKey withID:@"id_rsa"]) != nil) {
publicKeyMemory = [pk.publicKey UTF8String];
privateKeyMemory = [[pk loadPrivateKey] UTF8String];
sshc->rsa = strdup("id_rsa");
}
}
if (!(privateKeyMemory && publicKeyMemory)) {
// Still no luck, try with id_dsa:
if ((pk = [BKPubKey withID:@"id_dsa"]) != nil) {
publicKeyMemory = [pk.publicKey UTF8String];
privateKeyMemory = [[pk loadPrivateKey] UTF8String];
sshc->rsa = strdup("id_dsa");
}
}
#endif
/* If no private key file is specified, try some common paths. */
if(home) {
/* Try ~/.ssh first. */
32 changes: 9 additions & 23 deletions curl_ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 48;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
@@ -354,8 +354,7 @@
2219E2CB1FD7E58600675252 /* tool_writeout.h in Headers */ = {isa = PBXBuildFile; fileRef = 2219E2681FD7E58600675252 /* tool_writeout.h */; };
2219E2CC1FD7E58600675252 /* tool_xattr.c in Sources */ = {isa = PBXBuildFile; fileRef = 2219E2691FD7E58600675252 /* tool_xattr.c */; };
2219E2CD1FD7E58600675252 /* tool_xattr.h in Headers */ = {isa = PBXBuildFile; fileRef = 2219E26A1FD7E58600675252 /* tool_xattr.h */; };
2219E2D51FD7EE9700675252 /* openssl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2219E2D41FD7EE9700675252 /* openssl.framework */; };
2219E2D71FD7EEB800675252 /* libssh2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2219E2D61FD7EEB800675252 /* libssh2.framework */; };
BDF040DF2C9B1C64005B7138 /* openssl.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = BDF2B8E12BC490BE00B9C7EA /* openssl.xcframework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
@@ -708,17 +707,15 @@
2219E2681FD7E58600675252 /* tool_writeout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tool_writeout.h; sourceTree = "<group>"; };
2219E2691FD7E58600675252 /* tool_xattr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tool_xattr.c; sourceTree = "<group>"; };
2219E26A1FD7E58600675252 /* tool_xattr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tool_xattr.h; sourceTree = "<group>"; };
2219E2D41FD7EE9700675252 /* openssl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = openssl.framework; path = "../libssh2-for-iOS/openssl.framework"; sourceTree = "<group>"; };
2219E2D61FD7EEB800675252 /* libssh2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libssh2.framework; path = "../libssh2-for-iOS/libssh2.framework"; sourceTree = "<group>"; };
BDF2B8E12BC490BE00B9C7EA /* openssl.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = openssl.xcframework; path = xcfs/.build/artifacts/xcfs/openssl/openssl.xcframework; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
2219DFCB1FD73AF500675252 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
2219E2D71FD7EEB800675252 /* libssh2.framework in Frameworks */,
2219E2D51FD7EE9700675252 /* openssl.framework in Frameworks */,
BDF040DF2C9B1C64005B7138 /* openssl.xcframework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1134,8 +1131,7 @@
2219E2D01FD7EDE600675252 /* Frameworks */ = {
isa = PBXGroup;
children = (
2219E2D61FD7EEB800675252 /* libssh2.framework */,
2219E2D41FD7EE9700675252 /* openssl.framework */,
BDF2B8E12BC490BE00B9C7EA /* openssl.xcframework */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -1691,7 +1687,7 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = curl_ios/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited)";
MACH_O_TYPE = staticlib;
OTHER_CFLAGS = (
"-DHAVE_CONFIG_H",
@@ -1700,13 +1696,8 @@
"-I",
curl/curl/lib/,
"-DBUILDING_LIBCURL",
"-I",
"../libssh2-for-iOS/include/libssh2/",
);
OTHER_LDFLAGS = (
"-F",
"../../libssh2-for-iOS/",
);
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = "Acube.curl-ios";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
@@ -1724,7 +1715,7 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = curl_ios/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited)";
MACH_O_TYPE = staticlib;
OTHER_CFLAGS = (
"-DHAVE_CONFIG_H",
@@ -1733,13 +1724,8 @@
"-I",
curl/curl/lib/,
"-DBUILDING_LIBCURL",
"-I",
"../libssh2-for-iOS/include/libssh2/",
);
OTHER_LDFLAGS = (
"-F",
"../../libssh2-for-iOS/",
);
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = "Acube.curl-ios";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Loading