diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-08-19 13:52:16 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-08-19 13:52:16 +0200 |
commit | 4067891ed9f66eb5e47a709d3ea21c2ed36a1e86 (patch) | |
tree | 6af58030bf1d7b85999fe346ff5d1b1c64705fbc | |
parent | 81d0e570be0db784e98fdb7ad63f9b65c6745be3 (diff) | |
download | anastasis-4067891ed9f66eb5e47a709d3ea21c2ed36a1e86.tar.gz anastasis-4067891ed9f66eb5e47a709d3ea21c2ed36a1e86.zip |
modify lib/ to pass 202 status back to reducer
-rw-r--r-- | src/include/anastasis.h | 12 | ||||
-rw-r--r-- | src/lib/anastasis_recovery.c | 19 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_keyshare_lookup.c | 2 | ||||
-rw-r--r-- | src/testing/testing_cmd_challenge_answer.c | 4 |
4 files changed, 34 insertions, 3 deletions
diff --git a/src/include/anastasis.h b/src/include/anastasis.h index f9782fd..8443eb6 100644 --- a/src/include/anastasis.h +++ b/src/include/anastasis.h | |||
@@ -138,7 +138,14 @@ enum ANASTASIS_ChallengeStatus | |||
138 | * challenge in time. The request should be repeated | 138 | * challenge in time. The request should be repeated |
139 | * later and may then succeed. | 139 | * later and may then succeed. |
140 | */ | 140 | */ |
141 | ANASTASIS_CHALLENGE_STATUS_AUTH_TIMEOUT | 141 | ANASTASIS_CHALLENGE_STATUS_AUTH_TIMEOUT, |
142 | |||
143 | /** | ||
144 | * Plugin-specific ("external") instructions for how to solve the | ||
145 | * challenge are provided. | ||
146 | */ | ||
147 | ANASTASIS_CHALLENGE_STATUS_EXTERNAL_INSTRUCTIONS | ||
148 | |||
142 | 149 | ||
143 | }; | 150 | }; |
144 | 151 | ||
@@ -166,7 +173,8 @@ struct ANASTASIS_ChallengeStartResponse | |||
166 | 173 | ||
167 | /** | 174 | /** |
168 | * Challenge details provided if | 175 | * Challenge details provided if |
169 | * @e cs is #ANASTASIS_CHALLENGE_STATUS_INSTRUCTIONS. | 176 | * @e cs is #ANASTASIS_CHALLENGE_STATUS_INSTRUCTIONS |
177 | * or #ANASTASIS_CHALLENGE_STATUS_EXTERNAL_INSTRUCTIONS. | ||
170 | */ | 178 | */ |
171 | struct | 179 | struct |
172 | { | 180 | { |
diff --git a/src/lib/anastasis_recovery.c b/src/lib/anastasis_recovery.c index f65da8c..4e23db0 100644 --- a/src/lib/anastasis_recovery.c +++ b/src/lib/anastasis_recovery.c | |||
@@ -352,6 +352,25 @@ keyshare_lookup_cb (void *cls, | |||
352 | &csr); | 352 | &csr); |
353 | return; | 353 | return; |
354 | } | 354 | } |
355 | case ANASTASIS_KSD_EXTERNAL_CHALLENGE_INSTRUCTIONS: | ||
356 | { | ||
357 | struct ANASTASIS_ChallengeStartResponse csr = { | ||
358 | .cs = ANASTASIS_CHALLENGE_STATUS_EXTERNAL_INSTRUCTIONS, | ||
359 | .challenge = c, | ||
360 | .details.open_challenge.body | ||
361 | = dd->details.open_challenge.body, | ||
362 | .details.open_challenge.content_type | ||
363 | = dd->details.open_challenge.content_type, | ||
364 | .details.open_challenge.body_size | ||
365 | = dd->details.open_challenge.body_size, | ||
366 | .details.open_challenge.http_status | ||
367 | = dd->details.open_challenge.http_status | ||
368 | }; | ||
369 | |||
370 | c->af (c->af_cls, | ||
371 | &csr); | ||
372 | return; | ||
373 | } | ||
355 | } | 374 | } |
356 | 375 | ||
357 | GNUNET_assert (NULL != dd); | 376 | GNUNET_assert (NULL != dd); |
diff --git a/src/testing/testing_api_cmd_keyshare_lookup.c b/src/testing/testing_api_cmd_keyshare_lookup.c index c9f8e45..04ecf43 100644 --- a/src/testing/testing_api_cmd_keyshare_lookup.c +++ b/src/testing/testing_api_cmd_keyshare_lookup.c | |||
@@ -206,6 +206,8 @@ keyshare_lookup_cb (void *cls, | |||
206 | break; | 206 | break; |
207 | case ANASTASIS_KSD_AUTHENTICATION_TIMEOUT: | 207 | case ANASTASIS_KSD_AUTHENTICATION_TIMEOUT: |
208 | break; | 208 | break; |
209 | case ANASTASIS_KSD_EXTERNAL_CHALLENGE_INSTRUCTIONS: | ||
210 | break; | ||
209 | } | 211 | } |
210 | TALER_TESTING_interpreter_next (ksls->is); | 212 | TALER_TESTING_interpreter_next (ksls->is); |
211 | } | 213 | } |
diff --git a/src/testing/testing_cmd_challenge_answer.c b/src/testing/testing_cmd_challenge_answer.c index d7d11a1..ff897f3 100644 --- a/src/testing/testing_cmd_challenge_answer.c +++ b/src/testing/testing_cmd_challenge_answer.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of Anastasis | 2 | This file is part of Anastasis |
3 | Copyright (C) 2020 Anastasis SARL | 3 | Copyright (C) 2020, 2021 Anastasis SARL |
4 | 4 | ||
5 | Anastasis is free software; you can redistribute it and/or modify it under the | 5 | Anastasis is free software; you can redistribute it and/or modify it under the |
6 | terms of the GNU Lesser General Public License as published by the Free Software | 6 | terms of the GNU Lesser General Public License as published by the Free Software |
@@ -239,6 +239,8 @@ challenge_answer_cb (void *af_cls, | |||
239 | break; | 239 | break; |
240 | case ANASTASIS_CHALLENGE_STATUS_AUTH_TIMEOUT: | 240 | case ANASTASIS_CHALLENGE_STATUS_AUTH_TIMEOUT: |
241 | break; | 241 | break; |
242 | case ANASTASIS_CHALLENGE_STATUS_EXTERNAL_INSTRUCTIONS: | ||
243 | break; | ||
242 | } | 244 | } |
243 | TALER_TESTING_interpreter_next (cs->is); | 245 | TALER_TESTING_interpreter_next (cs->is); |
244 | } | 246 | } |