Skip to content

Commit 4d3ca8e

Browse files
authored
Merge pull request #521 from infosiftr/argon2
Add Argon2 password hashing
2 parents d8d798b + 2577f11 commit 4d3ca8e

File tree

6 files changed

+31
-0
lines changed

6 files changed

+31
-0
lines changed

7.2-rc/stretch/apache/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ RUN apt-get update && apt-get install -y \
2222
$PHPIZE_DEPS \
2323
ca-certificates \
2424
curl \
25+
libargon2-0 \
2526
libedit2 \
2627
libsqlite3-0 \
2728
libxml2 \
@@ -153,6 +154,7 @@ COPY docker-php-source /usr/local/bin/
153154
RUN set -xe \
154155
&& buildDeps=" \
155156
$PHP_EXTRA_BUILD_DEPS \
157+
libargon2-0-dev \
156158
libcurl4-openssl-dev \
157159
libedit-dev \
158160
libsqlite3-dev \
@@ -186,6 +188,8 @@ RUN set -xe \
186188
--enable-mbstring \
187189
# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
188190
--enable-mysqlnd \
191+
# https://wiki.php.net/rfc/argon2_password_hash (7.2+)
192+
--with-password-argon2 \
189193
\
190194
--with-curl \
191195
--with-libedit \

7.2-rc/stretch/cli/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ RUN apt-get update && apt-get install -y \
2222
$PHPIZE_DEPS \
2323
ca-certificates \
2424
curl \
25+
libargon2-0 \
2526
libedit2 \
2627
libsqlite3-0 \
2728
libxml2 \
@@ -94,6 +95,7 @@ COPY docker-php-source /usr/local/bin/
9495
RUN set -xe \
9596
&& buildDeps=" \
9697
$PHP_EXTRA_BUILD_DEPS \
98+
libargon2-0-dev \
9799
libcurl4-openssl-dev \
98100
libedit-dev \
99101
libsqlite3-dev \
@@ -127,6 +129,8 @@ RUN set -xe \
127129
--enable-mbstring \
128130
# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
129131
--enable-mysqlnd \
132+
# https://wiki.php.net/rfc/argon2_password_hash (7.2+)
133+
--with-password-argon2 \
130134
\
131135
--with-curl \
132136
--with-libedit \

7.2-rc/stretch/fpm/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ RUN apt-get update && apt-get install -y \
2222
$PHPIZE_DEPS \
2323
ca-certificates \
2424
curl \
25+
libargon2-0 \
2526
libedit2 \
2627
libsqlite3-0 \
2728
libxml2 \
@@ -95,6 +96,7 @@ COPY docker-php-source /usr/local/bin/
9596
RUN set -xe \
9697
&& buildDeps=" \
9798
$PHP_EXTRA_BUILD_DEPS \
99+
libargon2-0-dev \
98100
libcurl4-openssl-dev \
99101
libedit-dev \
100102
libsqlite3-dev \
@@ -128,6 +130,8 @@ RUN set -xe \
128130
--enable-mbstring \
129131
# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
130132
--enable-mysqlnd \
133+
# https://wiki.php.net/rfc/argon2_password_hash (7.2+)
134+
--with-password-argon2 \
131135
\
132136
--with-curl \
133137
--with-libedit \

7.2-rc/stretch/zts/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ RUN apt-get update && apt-get install -y \
2222
$PHPIZE_DEPS \
2323
ca-certificates \
2424
curl \
25+
libargon2-0 \
2526
libedit2 \
2627
libsqlite3-0 \
2728
libxml2 \
@@ -95,6 +96,7 @@ COPY docker-php-source /usr/local/bin/
9596
RUN set -xe \
9697
&& buildDeps=" \
9798
$PHP_EXTRA_BUILD_DEPS \
99+
libargon2-0-dev \
98100
libcurl4-openssl-dev \
99101
libedit-dev \
100102
libsqlite3-dev \
@@ -128,6 +130,8 @@ RUN set -xe \
128130
--enable-mbstring \
129131
# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
130132
--enable-mysqlnd \
133+
# https://wiki.php.net/rfc/argon2_password_hash (7.2+)
134+
--with-password-argon2 \
131135
\
132136
--with-curl \
133137
--with-libedit \

Dockerfile-debian.template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ RUN apt-get update && apt-get install -y \
1616
$PHPIZE_DEPS \
1717
ca-certificates \
1818
curl \
19+
libargon2-0 \
1920
libedit2 \
2021
libsqlite3-0 \
2122
libxml2 \
@@ -88,6 +89,7 @@ COPY docker-php-source /usr/local/bin/
8889
RUN set -xe \
8990
&& buildDeps=" \
9091
$PHP_EXTRA_BUILD_DEPS \
92+
libargon2-0-dev \
9193
libcurl4-openssl-dev \
9294
libedit-dev \
9395
libsqlite3-dev \
@@ -121,6 +123,8 @@ RUN set -xe \
121123
--enable-mbstring \
122124
# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
123125
--enable-mysqlnd \
126+
# https://wiki.php.net/rfc/argon2_password_hash (7.2+)
127+
--with-password-argon2 \
124128
\
125129
--with-curl \
126130
--with-libedit \

update.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ travisEnv=
5252
for version in "${versions[@]}"; do
5353
rcVersion="${version%-rc}"
5454

55+
# "7", "5", etc
56+
majorVersion="${rcVersion%%.*}"
57+
# "2", "1", "6", etc
58+
minorVersion="${rcVersion#$majorVersion.}"
59+
minorVersion="${minorVersion%%.*}"
60+
5561
# scrape the relevant API based on whether we're looking for pre-releases
5662
apiUrl="https://secure.php.net/releases/index.php?json&max=100&version=${rcVersion%%.*}"
5763
apiJqExpr='
@@ -150,6 +156,11 @@ for version in "${versions[@]}"; do
150156
if [ "$alpineVer" = '3.4' ]; then
151157
sed -ri 's!libressl!openssl!g' "$version/$suite/$variant/Dockerfile"
152158
fi
159+
if [ "$majorVersion" = '5' ] || [ "$majorVersion" = '7' -a "$minorVersion" -lt '2' ] || [ "$suite" = 'jessie' ]; then
160+
# argon2 password hashing is only supported in 7.2+ and stretch+
161+
sed -ri '/argon2/d' "$version/$suite/$variant/Dockerfile"
162+
# Alpine 3.7+ _should_ include an "argon2-dev" package, but we should cross that bridge when we come to it
163+
fi
153164

154165
# automatic `-slim` for stretch
155166
# TODO always add slim once jessie is removed

0 commit comments

Comments
 (0)