commit 8e34db6e3d5f0e0101d14931f96944693c459cdf
parent 6b9b2158814ab03c14eb147f94e0f34b9c7d5ce4
Author: MS <ms@taler.net>
Date: Tue, 31 Aug 2021 21:57:05 -1100
Errors policy.
No data available becomes non-error and non-verifying signatures
get appropriate error code (they used to throw "invalid request").
Diffstat:
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt
@@ -84,7 +84,7 @@ suspend fun doEbicsDownloadTransaction(
val initResponse = parseAndValidateEbicsResponse(subscriberDetails, initResponseStr)
when (initResponse.technicalReturnCode) {
- EbicsReturnCode.EBICS_OK -> {
+ EbicsReturnCode.EBICS_OK, EbicsReturnCode.EBICS_NO_DOWNLOAD_DATA_AVAILABLE -> {
// Success, nothing to do!
}
else -> {
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt
@@ -79,6 +79,10 @@ class EbicsInvalidRequestError : EbicsRequestError(
"[EBICS_INVALID_REQUEST] Invalid request",
"060102"
)
+class EbicsAccountAuthorisationFailed : EbicsRequestError(
+ "[EBICS_ACCOUNT_AUTHORISATION_FAILED] Subscriber's signature didn't verify",
+ "091302"
+)
/**
* This error is thrown whenever the Subscriber's state is not suitable
@@ -1357,7 +1361,7 @@ suspend fun ApplicationCall.ebicsweb() {
// Step 2 of 3: Validate the signature
val verifyResult = XMLUtil.verifyEbicsDocument(requestDocument, requestContext.clientAuthPub)
if (!verifyResult) {
- throw EbicsInvalidRequestError()
+ throw EbicsAccountAuthorisationFailed()
}
// Step 3 of 3: Generate response
val ebicsResponse: EbicsResponse = when (requestObject.header.mutable.transactionPhase) {