aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/security
diff options
context:
space:
mode:
authorGravatar yang-g <yangg@google.com>2015-07-17 22:15:12 -0700
committerGravatar yang-g <yangg@google.com>2015-07-17 22:15:12 -0700
commit5e7e55b957a917c84d9272e5cd1111992ed1b7d5 (patch)
tree26dbeeb284ab4bfcda7eb0c8aca572838a41c9d7 /test/core/security
parent463cde7cf98c085abbb18e6e73fdc7b966938177 (diff)
parentf87a0984ab727e95b068237f3bb0689d9685c8ea (diff)
Merge with head and resolve conflict
Diffstat (limited to 'test/core/security')
-rw-r--r--test/core/security/json_token_test.c4
-rw-r--r--test/core/security/jwt_verifier_test.c70
-rw-r--r--test/core/security/oauth2_utils.c3
-rw-r--r--test/core/security/print_google_default_creds_token.c3
-rw-r--r--test/core/security/verify_jwt.c3
5 files changed, 43 insertions, 40 deletions
diff --git a/test/core/security/json_token_test.c b/test/core/security/json_token_test.c
index b43e0425ee..da57cef15c 100644
--- a/test/core/security/json_token_test.c
+++ b/test/core/security/json_token_test.c
@@ -269,8 +269,8 @@ static void check_jwt_header(grpc_json *header) {
static void check_jwt_claim(grpc_json *claim, const char *expected_audience,
const char *expected_scope) {
- gpr_timespec expiration = {0, 0};
- gpr_timespec issue_time = {0, 0};
+ gpr_timespec expiration = gpr_time_0(GPR_CLOCK_REALTIME);
+ gpr_timespec issue_time = gpr_time_0(GPR_CLOCK_REALTIME);
gpr_timespec parsed_lifetime;
grpc_json *iss = NULL;
grpc_json *scope = NULL;
diff --git a/test/core/security/jwt_verifier_test.c b/test/core/security/jwt_verifier_test.c
index 46b96d9ecb..98db56c0ef 100644
--- a/test/core/security/jwt_verifier_test.c
+++ b/test/core/security/jwt_verifier_test.c
@@ -1,35 +1,35 @@
/*
- *
- * Copyright 2015, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
+*
+*Copyright 2015, Google Inc.
+*All rights reserved.
+*
+*Redistribution and use in source and binary forms, with or without
+*modification, are permitted provided that the following conditions are
+*met:
+*
+* * Redistributions of source code must retain the above copyright
+*notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above
+*copyright notice, this list of conditions and the following disclaimer
+*in the documentation and/or other materials provided with the
+*distribution.
+* * Neither the name of Google Inc. nor the names of its
+*contributors may be used to endorse or promote products derived from
+*this software without specific prior written permission.
+*
+*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+*A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+*OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+*SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+*LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+*DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+*THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+*(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+*OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+*/
#include "src/core/security/jwt_verifier.h"
@@ -115,7 +115,7 @@ static const char good_jwk_set[] =
" ]"
"}";
-static gpr_timespec expected_lifetime = {3600, 0};
+static gpr_timespec expected_lifetime = {3600, 0, GPR_TIMESPAN};
static const char good_google_email_keys_part1[] =
"{\"e6b5137873db8d2ef81e06a47289e6434ec8a165\": \"-----BEGIN "
@@ -201,9 +201,9 @@ static void test_expired_claims_failure(void) {
gpr_slice s = gpr_slice_from_copied_string(expired_claims);
grpc_json *json = grpc_json_parse_string_with_len(
(char *)GPR_SLICE_START_PTR(s), GPR_SLICE_LENGTH(s));
- gpr_timespec exp_iat = {100, 0};
- gpr_timespec exp_exp = {120, 0};
- gpr_timespec exp_nbf = {60, 0};
+ gpr_timespec exp_iat = {100, 0, GPR_CLOCK_REALTIME};
+ gpr_timespec exp_exp = {120, 0, GPR_CLOCK_REALTIME};
+ gpr_timespec exp_nbf = {60, 0, GPR_CLOCK_REALTIME};
GPR_ASSERT(json != NULL);
claims = grpc_jwt_claims_from_json(json, s);
GPR_ASSERT(claims != NULL);
diff --git a/test/core/security/oauth2_utils.c b/test/core/security/oauth2_utils.c
index 3e4285256a..ecd04fd9e1 100644
--- a/test/core/security/oauth2_utils.c
+++ b/test/core/security/oauth2_utils.c
@@ -83,7 +83,8 @@ char *grpc_test_fetch_oauth2_token_with_credentials(grpc_credentials *creds) {
on_oauth2_response, &request);
gpr_mu_lock(GRPC_POLLSET_MU(&request.pollset));
- while (!request.is_done) grpc_pollset_work(&request.pollset, gpr_inf_future);
+ while (!request.is_done)
+ grpc_pollset_work(&request.pollset, gpr_inf_future(GPR_CLOCK_REALTIME));
gpr_mu_unlock(GRPC_POLLSET_MU(&request.pollset));
grpc_pollset_shutdown(&request.pollset, do_nothing, NULL);
diff --git a/test/core/security/print_google_default_creds_token.c b/test/core/security/print_google_default_creds_token.c
index 5b55a4da13..0875cfb4fb 100644
--- a/test/core/security/print_google_default_creds_token.c
+++ b/test/core/security/print_google_default_creds_token.c
@@ -95,7 +95,8 @@ int main(int argc, char **argv) {
on_metadata_response, &sync);
gpr_mu_lock(GRPC_POLLSET_MU(&sync.pollset));
- while (!sync.is_done) grpc_pollset_work(&sync.pollset, gpr_inf_future);
+ while (!sync.is_done)
+ grpc_pollset_work(&sync.pollset, gpr_inf_future(GPR_CLOCK_REALTIME));
gpr_mu_unlock(GRPC_POLLSET_MU(&sync.pollset));
grpc_credentials_release(creds);
diff --git a/test/core/security/verify_jwt.c b/test/core/security/verify_jwt.c
index e90be5de98..cb073f19c7 100644
--- a/test/core/security/verify_jwt.c
+++ b/test/core/security/verify_jwt.c
@@ -109,7 +109,8 @@ int main(int argc, char **argv) {
on_jwt_verification_done, &sync);
gpr_mu_lock(GRPC_POLLSET_MU(&sync.pollset));
- while (!sync.is_done) grpc_pollset_work(&sync.pollset, gpr_inf_future);
+ while (!sync.is_done)
+ grpc_pollset_work(&sync.pollset, gpr_inf_future(GPR_CLOCK_REALTIME));
gpr_mu_unlock(GRPC_POLLSET_MU(&sync.pollset));
grpc_jwt_verifier_destroy(verifier);