<table><tr><td style="">fvogt created this revision.<br />Restricted Application added a project: Plasma.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D6091" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The receiver (kcheckpass) reads a string and if it is !nullptr, reads an int:</p>

<p>msg = GRecvStr ();<br />
        if (msg && (GRecvInt() & IsPassword) && !*msg)</p>

<p>The sender (kscreenlocker_greet) sends a string and if it is not empty,<br />
sends an int:</p>

<p>GSendStr(m_password.toUtf8().constData());<br />
        if (!m_password.isEmpty()) {</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">              // IsSecret
                GSendInt(1);</pre></div>

<p>}</p>

<p>This does not work out for empty strings, as those still have a length of 1,<br />
resulting in kcheckpass waiting indefinitely for an int that does not get sent.<br />
Testing for a nullptr on the sender side instead of the string length fixes this.</p>

<p>Also clean up the code duplication and IsSecret (1)/IsPassword (2) mismatch.</p>

<p>BUG: 380491</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Reproduced the bug without this patch, with this patch it does not<br />
happen anymore. Authentication still works and fails as expected.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R133 KScreenLocker</div></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D6091" rel="noreferrer">https://phabricator.kde.org/D6091</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>greeter/authenticator.cpp</div></div></div><br /><div><strong>To: </strong>fvogt, Plasma<br /><strong>Cc: </strong>plasma-devel, ZrenBot, spstarr, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, lukas<br /></div>