46

解決済みうわー、こいつらは速い... 基本的にはこれですhttps://github.com/pyca/cryptography/issues/2750 openssl のセキュリティ更新プログラム (DROWN 攻撃) がリリースされ、その更新プログラムに予期しない機能が含まれていることが判明しました署名の変更が非互換性を引き起こしたので、これは私にとって不運でした。


pip install cryptographyAlpine Linux を実行している Docker コンテナーで使用する必要があります。実際には別のモジュールですが、依存関係であるモジュールにservice_identity問題があります。cryptography

次の Dockerfile があります

FROM alpine:3.3

RUN apk --update add build-base libffi-dev openssl-dev python-dev py-pip
RUN pip install cryptography

次のエラーで失敗します

generating cffi module 'build/temp.linux-x86_64-2.7/_openssl.c'
building '_openssl' extension
creating build/temp.linux-x86_64-2.7/build
creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
gcc -fno-strict-aliasing -Os -fomit-frame-pointer -DNDEBUG -Os -fomit-frame-pointer -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/_openssl.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o
build/temp.linux-x86_64-2.7/_openssl.c:726:6: error: conflicting types for 'BIO_new_mem_buf'
 BIO *BIO_new_mem_buf(void *, int);
      ^
In file included from /usr/include/openssl/asn1.h:65:0,
                 from build/temp.linux-x86_64-2.7/_openssl.c:434:
/usr/include/openssl/bio.h:692:6: note: previous declaration of 'BIO_new_mem_buf' was here
 BIO *BIO_new_mem_buf(const void *buf, int len);
      ^
error: command 'gcc' failed with exit status 1

openssl 1.0.2g は 2016 年 3 月 1 日 (昨日) にリリースされ、alpine パッケージは既にそのバージョンに更新されています。これに関連する可能性はありますか?

この問題を解決するにはどうすればよいですか? 多分私が設定できるいくつかの環境変数?

更新opensslのGitHubリポジトリをチェックしており、実際BIO *BIO_new_mem_buf(void *buf, int len)には1.0.2fから1.0.2gへの移行中にopenssl/bio.h変更されました( https://github.com/openssl/openssl/compare/で「BIO_new_mem_buf」を検索してください) OpenSSL_1_0_2f...OpenSSL_1_0_2g )。の古いバージョンをインポートしているこれがどこから来ているのかわかりません。これは、openssl リポジトリのものとは似ていないためです。何か案は?BIO *BIO_new_mem_buf(const void *buf, int len)openssl/asn1.hopenssl/bio.h

わかりました、すでにこれに取り組んでいる人もいます: https://github.com/pyca/cryptography/issues/2750

4

5 に答える 5

14

Rust のバージョンが原因で失敗する場合は、暗号化のドキュメントで次のことをお勧めします。

The Rust available by default in Alpine < 3.12 is older than the 
minimum supported version. See the Rust installation instructions
 for information about installing a newer Rust.
$ sudo apk add gcc musl-dev python3-dev libffi-dev openssl-dev cargo

私の場合、python3.8-alpine、追加でcargo解決しました。

于 2021-04-30T18:52:23.037 に答える
0

または、build-base を使用します。

RUN apk add --no-cache --upgrade --virtual .build-deps build-base

詳細はこちら: https://git.alpinelinux.org/aports/tree/main/build-base/APKBUILD?h=3.3-stable

于 2021-07-22T03:12:21.630 に答える
-1

適切なアーキテクチャを構築しているかどうかを確認してください !!

x86-64 または amd64 アーキテクチャは同様のソフトウェアを実行し、他のカテゴリは aarch64 または Apple Silicon M1 や携帯電話の CPU などのアーム アーキテクチャ チップです。

于 2021-10-23T23:03:39.610 に答える