Skip to content

Commit 7593b72

Browse files
TimUnderhayfitzyjoe
authored andcommitted
build.sh fix for MacOS Docker.
Removed memcpy op for RSA validation and use pointer instead
1 parent 4aab233 commit 7593b72

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ fi
1515

1616
CONTAINER_ID=$(docker run --name "${DOCKER_IMAGE_NAME}-cont" -d -p 8000:8000 ${DOCKER_IMAGE_NAME})
1717

18-
MACHINE_IP=`docker-machine ip`
18+
if ! MACHINE_IP=`docker-machine ip 2>/dev/null`; then
19+
MACHINE_IP='0.0.0.0' # fix for MacOS
20+
fi
1921

2022
docker cp ${CONTAINER_ID}:/usr/lib64/nginx/modules/ngx_http_auth_jwt_module.so .
2123

ngx_http_auth_jwt_module.so

736 Bytes
Binary file not shown.

src/ngx_http_auth_jwt_module.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ static ngx_int_t ngx_http_auth_jwt_handler(ngx_http_request_t *r)
171171
else if ( auth_jwt_algorithm.len == sizeof("RS256") - 1 && ngx_strncmp(auth_jwt_algorithm.data, "RS256", sizeof("RS256") - 1) == 0 )
172172
{
173173
// in this case, 'Binary' is a misnomer, as it is the public key string itself
174-
keyBinary = ngx_palloc(r->pool, jwtcf->auth_jwt_key.len);
175-
ngx_memcpy(keyBinary, jwtcf->auth_jwt_key.data, jwtcf->auth_jwt_key.len);
174+
keyBinary = jwtcf->auth_jwt_key.data;
176175
keylen = jwtcf->auth_jwt_key.len;
177176
}
178177
else

0 commit comments

Comments
 (0)