質問編集履歴
9
記述
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,11 +2,13 @@
|
|
2
2
|
|
3
3
|
C++のxcodeプロジェクト内で、OpenSSLの関数を使いたい
|
4
4
|
|
5
|
+
### 解決方法
|
6
|
+
|
7
|
+
Xcodeプロジェクトの設定から、"Disable Library Validation"にチェックを入れる(詳細下記)
|
8
|
+
|
5
9
|
### 発生している問題・エラーメッセージ
|
6
10
|
|
7
11
|
実行時エラー
|
8
|
-
|
9
|
-
|
10
12
|
|
11
13
|
コンソール内->の行に`Thread 1: signal SIGABRT`
|
12
14
|
|
8
タイトル
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
C++のThread 1: signal SIGABRT
|
test
CHANGED
File without changes
|
7
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,7 +8,43 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
|
11
|
+
コンソール内->の行に`Thread 1: signal SIGABRT`
|
12
|
+
|
11
13
|
```
|
14
|
+
|
15
|
+
dyld`__abort_with_payload:
|
16
|
+
|
17
|
+
0x10005f23c <+0>: movl $0x2000209, %eax ; imm = 0x2000209
|
18
|
+
|
19
|
+
0x10005f241 <+5>: movq %rcx, %r10
|
20
|
+
|
21
|
+
0x10005f244 <+8>: syscall
|
22
|
+
|
23
|
+
-> 0x10005f246 <+10>: jae 0x10005f250 ; <+20>
|
24
|
+
|
25
|
+
0x10005f248 <+12>: movq %rax, %rdi
|
26
|
+
|
27
|
+
0x10005f24b <+15>: jmp 0x10005d769 ; cerror_nocancel
|
28
|
+
|
29
|
+
0x10005f250 <+20>: retq
|
30
|
+
|
31
|
+
0x10005f251 <+21>: nop
|
32
|
+
|
33
|
+
0x10005f252 <+22>: nop
|
34
|
+
|
35
|
+
0x10005f253 <+23>: nop
|
36
|
+
|
37
|
+
```
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
```
|
44
|
+
|
45
|
+
Project > Thread1 > 0_abort_with_payloadの内容
|
46
|
+
|
47
|
+
|
12
48
|
|
13
49
|
dyld: Library not loaded: /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib
|
14
50
|
|
6
タイトル
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
OpenSSLの実行時エラー(Xcode)
|
test
CHANGED
File without changes
|
5
進展
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
XcodeでOpenSSL
|
1
|
+
XcodeでOpenSSLが使えない
|
test
CHANGED
@@ -4,17 +4,45 @@
|
|
4
4
|
|
5
5
|
### 発生している問題・エラーメッセージ
|
6
6
|
|
7
|
-
|
7
|
+
実行時エラー
|
8
8
|
|
9
|
-
Buildtime(2)
|
10
9
|
|
11
|
-
->Undefined symbol: _EVP_sha256
|
12
|
-
|
13
|
-
->Undefined symbol: _PKCS5_PBKDF2_HMAC
|
14
10
|
|
15
11
|
```
|
16
12
|
|
17
|
-
|
13
|
+
dyld: Library not loaded: /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib
|
14
|
+
|
15
|
+
Referenced from: /Users/name/Library/Developer/Xcode/DerivedData/SPAKE2P-gifrsublnqrqjygdglcbpkbnebwt/Build/Products/Debug/SPAKE2P
|
16
|
+
|
17
|
+
Reason: no suitable image found. Did find:
|
18
|
+
|
19
|
+
/usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib: code signature in (/usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
|
20
|
+
|
21
|
+
/usr/local/Cellar/openssl@1.1/1.1.1d/lib/libssl.1.1.dylib: code signature in (/usr/local/Cellar/openssl@1.1/1.1.1d/lib/libssl.1.1.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
|
22
|
+
|
23
|
+
(lldb)
|
24
|
+
|
25
|
+
```
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
Build Phases->Link Binary with Librariesに
|
34
|
+
|
35
|
+
`/usr/local/opt/openssl@1.1/lib`内の全13ファイル(.pc, .dylib, .a)を
|
36
|
+
|
37
|
+
登録したところ、ビルドは成功しました。
|
38
|
+
|
39
|
+
~~Buildtime(2)~~
|
40
|
+
|
41
|
+
~~Undefined symbol: _EVP_sha256~~
|
42
|
+
|
43
|
+
~~Undefined symbol: _PKCS5_PBKDF2_HMAC~~
|
44
|
+
|
45
|
+
|
18
46
|
|
19
47
|
|
20
48
|
|
4
goji
test
CHANGED
File without changes
|
test
CHANGED
@@ -94,6 +94,8 @@
|
|
94
94
|
|
95
95
|
3.xcodeの設定
|
96
96
|
|
97
|
+
Build Settings>
|
98
|
+
|
97
99
|
・Header Search Paths(DebugもReleaseも)に以下を追加
|
98
100
|
|
99
101
|
|
3
タイトル
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Xcodeで
|
1
|
+
XcodeでOpenSSLを使う
|
test
CHANGED
File without changes
|
2
タイトル
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Xcodeで
|
1
|
+
Xcodeで外部のライブラリを使う
|
test
CHANGED
File without changes
|
1
コードレイアウト修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -32,19 +32,13 @@
|
|
32
32
|
|
33
33
|
int main(int argc, const char * argv[]) {
|
34
34
|
|
35
|
-
char pass[]="pass";
|
35
|
+
char pass[]="pass"; int passlen=4;
|
36
36
|
|
37
|
-
int passlen=4;
|
38
|
-
|
39
|
-
unsigned char salt[]="salt";
|
37
|
+
unsigned char salt[]="salt"; int saltlen=4;
|
40
|
-
|
41
|
-
int saltlen=4;
|
42
38
|
|
43
39
|
int iter=1;
|
44
40
|
|
45
|
-
const int keylen=32;
|
46
|
-
|
47
|
-
unsigned char out[keylen];
|
41
|
+
const int keylen=32; unsigned char out[keylen];
|
48
42
|
|
49
43
|
|
50
44
|
|