mirror of
https://github.com/palera1n/palera1n.git
synced 2026-12-05 07:44:36 +01:00
Update mbedtls
This commit is contained in:
1 parent
ff581a41e9
commit
f8319e44f1
3 files changed
+40
-38
No files matched your search
@@ -74,7 +74,7 @@ jobs:
|
|||||||
minos: 7.0
|
minos: 7.0
|
||||||
runs-on: macos-12
|
runs-on: macos-12
|
||||||
env:
|
env:
|
||||||
MBEDTLS_VERSION: 3.5.2
|
MBEDTLS_VERSION: 3.6.0
|
||||||
READLINE_VERSION: 8.2
|
READLINE_VERSION: 8.2
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -176,7 +176,6 @@ jobs:
|
|||||||
- name: Build Mbed TLS
|
- name: Build Mbed TLS
|
||||||
run: |
|
run: |
|
||||||
cd mbedtls-${{ env.MBEDTLS_VERSION }}
|
cd mbedtls-${{ env.MBEDTLS_VERSION }}
|
||||||
cat ../patches/mbedtls/0001-Allow-empty-x509-cert-issuer.patch | patch -sN -d . -p1
|
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
SDKROOT="${{ env.SDK }}" cmake .. \
|
SDKROOT="${{ env.SDK }}" cmake .. \
|
||||||
@@ -250,6 +249,7 @@ jobs:
|
|||||||
- name: Build libimobiledevice
|
- name: Build libimobiledevice
|
||||||
run: |
|
run: |
|
||||||
cd libimobiledevice
|
cd libimobiledevice
|
||||||
|
cat ../patches/libimobiledevice/*.patch | patch -sN -d . -p1
|
||||||
autoreconf -fiv
|
autoreconf -fiv
|
||||||
./configure ${{ env.CONFIGURE_ARGS }} --with-mbedtls --enable-debug
|
./configure ${{ env.CONFIGURE_ARGS }} --with-mbedtls --enable-debug
|
||||||
echo -e 'all:\ninstall:' > tools/Makefile
|
echo -e 'all:\ninstall:' > tools/Makefile
|
||||||
@@ -477,7 +477,7 @@ jobs:
|
|||||||
- aarch64-linux-musl
|
- aarch64-linux-musl
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
MBEDTLS_VERSION: 3.5.2
|
MBEDTLS_VERSION: 3.6.0
|
||||||
LIBUSB_VERSION: 1.0.27
|
LIBUSB_VERSION: 1.0.27
|
||||||
READLINE_VERSION: 8.2
|
READLINE_VERSION: 8.2
|
||||||
GPM_VERSION: 1.20.7
|
GPM_VERSION: 1.20.7
|
||||||
@@ -568,7 +568,6 @@ jobs:
|
|||||||
- name: Build Mbed TLS
|
- name: Build Mbed TLS
|
||||||
run: |
|
run: |
|
||||||
cd mbedtls-${{ env.MBEDTLS_VERSION }}
|
cd mbedtls-${{ env.MBEDTLS_VERSION }}
|
||||||
cat ../patches/mbedtls/0001-Allow-empty-x509-cert-issuer.patch | patch -sN -d . -p1
|
|
||||||
mkdir build
|
mkdir build
|
||||||
if [ "${{ matrix.triple }}" = "i486-linux-musl" ]; then sed -i '/define MBEDTLS_AESNI_C/d' include/mbedtls/mbedtls_config.h; fi
|
if [ "${{ matrix.triple }}" = "i486-linux-musl" ]; then sed -i '/define MBEDTLS_AESNI_C/d' include/mbedtls/mbedtls_config.h; fi
|
||||||
cd build
|
cd build
|
||||||
@@ -659,6 +658,7 @@ jobs:
|
|||||||
- name: Build libimobiledevice
|
- name: Build libimobiledevice
|
||||||
run: |
|
run: |
|
||||||
cd libimobiledevice
|
cd libimobiledevice
|
||||||
|
cat ../patches/libimobiledevice/*.patch | patch -sN -d . -p1
|
||||||
autoreconf -fiv
|
autoreconf -fiv
|
||||||
./configure ${{ env.CONFIGURE_ARGS }} --with-mbedtls --enable-debug
|
./configure ${{ env.CONFIGURE_ARGS }} --with-mbedtls --enable-debug
|
||||||
echo -e 'all:\ninstall:' > tools/Makefile
|
echo -e 'all:\ninstall:' > tools/Makefile
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
diff -urN a/common/userpref.c b/common/userpref.c
|
||||||
|
--- a/common/userpref.c 2024-05-26 14:30:03
|
||||||
|
+++ b/common/userpref.c 2024-05-26 14:34:24
|
||||||
|
@@ -870,6 +870,10 @@
|
||||||
|
/* set key validity */
|
||||||
|
mbedtls_x509write_crt_set_validity(&cert, notbefore, notafter);
|
||||||
|
|
||||||
|
+ /* set subject and issuer name */
|
||||||
|
+ mbedtls_x509write_crt_set_subject_name(&cert, (const char *)"CN=in.palera.cli.subject,O=palera1n CLI Subject,C=TW");
|
||||||
|
+ mbedtls_x509write_crt_set_issuer_name(&cert, (const char *)"CN=in.palera.cli.issuer,O=palera1n CLI Issuer,C=TW");
|
||||||
|
+
|
||||||
|
/* sign root cert with root private key */
|
||||||
|
mbedtls_x509write_crt_set_issuer_key(&cert, &root_pkey);
|
||||||
|
mbedtls_x509write_crt_set_md_alg(&cert, MBEDTLS_MD_SHA1);
|
||||||
|
@@ -929,6 +933,10 @@
|
||||||
|
/* set key validity */
|
||||||
|
mbedtls_x509write_crt_set_validity(&cert, notbefore, notafter);
|
||||||
|
|
||||||
|
+ /* set subject and issuer name */
|
||||||
|
+ mbedtls_x509write_crt_set_subject_name(&cert, (const char *)"CN=in.palera.cli.subject,O=palera1n CLI Subject,C=TW");
|
||||||
|
+ mbedtls_x509write_crt_set_issuer_name(&cert, (const char *)"CN=in.palera.cli.issuer,O=palera1n CLI Issuer,C=TW");
|
||||||
|
+
|
||||||
|
/* sign host cert with root private key */
|
||||||
|
mbedtls_x509write_crt_set_issuer_key(&cert, &root_pkey);
|
||||||
|
mbedtls_x509write_crt_set_md_alg(&cert, MBEDTLS_MD_SHA1);
|
||||||
|
@@ -988,6 +996,10 @@
|
||||||
|
|
||||||
|
/* set key validity */
|
||||||
|
mbedtls_x509write_crt_set_validity(&cert, notbefore, notafter);
|
||||||
|
+
|
||||||
|
+ /* set subject and issuer name */
|
||||||
|
+ mbedtls_x509write_crt_set_subject_name(&cert, (const char *)"CN=in.palera.cli.subject,O=palera1n CLI Subject,C=TW");
|
||||||
|
+ mbedtls_x509write_crt_set_issuer_name(&cert, (const char *)"CN=in.palera.cli.issuer,O=palera1n CLI Issuer,C=TW");
|
||||||
|
|
||||||
|
/* sign device certificate with root private key */
|
||||||
|
mbedtls_x509write_crt_set_issuer_key(&cert, &root_pkey);
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
From a2d012f3ba459f6debe636b576ad9aeab7b3c2aa Mon Sep 17 00:00:00 2001
|
|
||||||
From: Nick Chan <[email protected]>
|
|
||||||
Date: Sat, 27 May 2023 23:50:23 +0800
|
|
||||||
Subject: [PATCH] Allow empty x509 cert issuer
|
|
||||||
|
|
||||||
---
|
|
||||||
library/x509_crt.c | 8 ++++----
|
|
||||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/library/x509_crt.c b/library/x509_crt.c
|
|
||||||
index cf62532f2..ef25b3d77 100644
|
|
||||||
--- a/library/x509_crt.c
|
|
||||||
+++ b/library/x509_crt.c
|
|
||||||
@@ -1061,13 +1061,13 @@ static int x509_crt_parse_der_core(mbedtls_x509_crt *crt,
|
|
||||||
|
|
||||||
if ((ret = mbedtls_asn1_get_tag(&p, end, &len,
|
|
||||||
MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE)) != 0) {
|
|
||||||
- mbedtls_x509_crt_free(crt);
|
|
||||||
- return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_FORMAT, ret);
|
|
||||||
+ /*mbedtls_x509_crt_free(crt);
|
|
||||||
+ return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_FORMAT, ret);*/
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((ret = mbedtls_x509_get_name(&p, p + len, &crt->issuer)) != 0) {
|
|
||||||
- mbedtls_x509_crt_free(crt);
|
|
||||||
- return ret;
|
|
||||||
+ /*mbedtls_x509_crt_free(crt);
|
|
||||||
+ return ret;*/
|
|
||||||
}
|
|
||||||
|
|
||||||
crt->issuer_raw.len = p - crt->issuer_raw.p;
|
|
||||||
--
|
|
||||||
2.39.1
|
|
||||||
|
|
||||||
Reference in new issue
Block a user