From a23bb0b7e2f6ae6af5ea8003fc7a3b651d918a04 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Sat, 1 Jul 2017 08:33:11 +0200 Subject: [PATCH] [raop] Clear auth_key for device verification if verify request to device is denied - should make it easier for user to setup a new pin --- src/outputs/raop.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/outputs/raop.c b/src/outputs/raop.c index b762ed1e..7f180b5f 100644 --- a/src/outputs/raop.c +++ b/src/outputs/raop.c @@ -4142,7 +4142,12 @@ raop_cb_verification_verify_step2(struct evrtsp_request *req, void *arg) ret = raop_verification_response_process(5, req, rs); if (ret < 0) - goto error; + { + // Clear auth_key, the device did not accept it + free(rs->device->auth_key); + rs->device->auth_key = NULL; + goto error; + } DPRINTF(E_INFO, L_RAOP, "Verification of '%s' completed succesfully\n", rs->devname); @@ -4165,7 +4170,12 @@ raop_cb_verification_verify_step1(struct evrtsp_request *req, void *arg) ret = raop_verification_response_process(4, req, rs); if (ret < 0) - goto error; + { + // Clear auth_key, the device did not accept it + free(rs->device->auth_key); + rs->device->auth_key = NULL; + goto error; + } ret = raop_verification_request_send(5, rs, raop_cb_verification_verify_step2); if (ret < 0)