<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - weston rdp-backend crash when "rdp4-key" option is used"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=91390">91390</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>weston rdp-backend crash when "rdp4-key" option is used
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Wayland
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>weston
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>wayland-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>gajownik@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=117240" name="attach_117240" title="weston output">attachment 117240</a> <a href="attachment.cgi?id=117240&action=edit" title="weston output">[details]</a></span>
weston output

Hi,

if you try to run weston with rdp-backend and rdp4-key option, program will
crash after client initializing a connection. For example execute 

weston --backend=rdp-backend.so --rdp4-key=test

and connect with any RDP client.

In src/compositor-rdp.c:1093 in rdp_peer_init() there's:

        client->Initialize(client);

        settings = client->settings;
        /* configure security settings */
        if (b->rdp_key)
                settings->RdpKeyFile = strdup(b->rdp_key);

client->Initialize(client) executes
libfreerdp/core/peer.c:freerdp_peer_initialize() from FreeRDP. It populates
settings->RdpServerRsaKey if settings->RdpKeyFile is set. As you can see above
rdp_peer_init() initializes settings->RdpKeyFile too late.

In the end settings->RdpServerRsaKey is not set and weston crashes when
libfreerdp/core/gcc.c:gcc_write_server_security_data() tries to access
    keyLen = settings->RdpServerRsaKey->ModulusLength;

Thanks,
     Dawid

weston and freerdp from today's git head.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>