Remove redundant code
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index 0fd0eff..c57583a 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -7508,11 +7508,7 @@
computation_stage->input_step = PSA_PAKE_STEP_X1_X2;
computation_stage->output_step = PSA_PAKE_STEP_X1_X2;
}
- } else {
- inputs.password_len = 0;
- inputs.password = NULL;
}
-
return status;
}
diff --git a/library/psa_crypto_pake.c b/library/psa_crypto_pake.c
index 382f021..fdfbd16 100644
--- a/library/psa_crypto_pake.c
+++ b/library/psa_crypto_pake.c
@@ -242,7 +242,6 @@
operation->buffer_offset = 0;
status = psa_pake_ecjpake_setup(operation);
-
if (status != PSA_SUCCESS) {
return status;
}
@@ -503,8 +502,6 @@
memcpy(output, operation->buffer, operation->buffer_length);
*output_size = operation->buffer_length;
- mbedtls_platform_zeroize(operation->buffer, MBEDTLS_PSA_PAKE_BUFFER_SIZE);
-
return PSA_SUCCESS;
} else
#else
@@ -518,9 +515,7 @@
#if defined(MBEDTLS_PSA_BUILTIN_ALG_JPAKE)
if (operation->alg == PSA_ALG_JPAKE) {
- if (operation->password_len > 0) {
- mbedtls_platform_zeroize(operation->password, operation->password_len);
- }
+ mbedtls_platform_zeroize(operation->password, operation->password_len);
mbedtls_free(operation->password);
operation->password = NULL;
operation->password_len = 0;