04d8ced3c4
In addition to restoring the secret setting again this removes some redundant logic and does minimal cleanups. Change-Id: I5dbcbd393b18befd762518e3865da9e006cf5bd9