[Bug 13647] DSM Plugin for UltraVNC 1.0.4 Doesn't Work

wine-bugs at winehq.org wine-bugs at winehq.org
Mon Mar 23 21:16:09 CDT 2009


http://bugs.winehq.org/show_bug.cgi?id=13647





--- Comment #7 from Chad Sikorra <chad.sikorra at gmail.com>  2009-03-23 21:16:09 ---
Just a little more info on this. I found out you can create a log for the DSM
plugin. Currently when it fails I get this in the log ...
-----------
03/22/09 18:52:09 : Importing ExponentOfOne KeyBlob
03/22/09 18:52:09 : Importing KEY KeyBlob
03/22/09 18:52:09 : Error importing key. - Last Error = -2146893815 : 
03/22/09 18:52:09 : Reading KeyBlob
03/22/09 18:52:09 : Importing ExponentOfOne KeyBlob
03/22/09 18:52:09 : Importing KEY KeyBlob
03/22/09 18:52:09 : Error importing key. - Last Error = -2146893815 : 
03/22/09 18:52:09 : Key File Read.
03/22/09 18:52:09 : CryptDecrypt failed.
03/22/09 18:52:18 : Shutting Down.
-----------
Error -2146893815 from the log occurs when the plugin calls CryptImportKey
(From crypto.cpp of the plugin's source) ...
-----------
PrintLog((DEST,"Importing KEY KeyBlob"));
//now, we convert the key blob back into a key (internally to the CSP), with
the call to CryptImportKey.
if (! CryptImportKey(hProvider, (const BYTE *)pbBuffer, dwByteCount,
hExchangeKey, 0, hKey)) {
    PrintLog((DEST,"Error importing key."));
    return -1;
}
-----------
MSDN just says that the error code is NTE_BAD_FLAGS which means the dwFlags
parameter was not valid. The point at which it chokes it Wine is in rsaenh.c in
this switch. It hits the default case for the switch and sets NTE_BAD_FLAGS and
the plugin bombs.
-----------
    /*
     * Check if the requested key length is supported by the current CSP.
     * Adjust key length's for DES algorithms.
     */

    switch (aiAlgid) {
        case CALG_DES:
            if (dwKeyLen == RSAENH_DES_EFFECTIVE_KEYLEN) {
                dwKeyLen = RSAENH_DES_STORAGE_KEYLEN;
            }
            if (dwKeyLen != RSAENH_DES_STORAGE_KEYLEN) {
                SetLastError(NTE_BAD_FLAGS);
                return (HCRYPTKEY)INVALID_HANDLE_VALUE;
            }
            break;

        case CALG_3DES_112:
            if (dwKeyLen == RSAENH_3DES112_EFFECTIVE_KEYLEN) {
                dwKeyLen = RSAENH_3DES112_STORAGE_KEYLEN;
            }
            if (dwKeyLen != RSAENH_3DES112_STORAGE_KEYLEN) {
                SetLastError(NTE_BAD_FLAGS);
                return (HCRYPTKEY)INVALID_HANDLE_VALUE;
            }
            break;

        case CALG_3DES:
            if (dwKeyLen == RSAENH_3DES_EFFECTIVE_KEYLEN) {
                dwKeyLen = RSAENH_3DES_STORAGE_KEYLEN;
            }
            if (dwKeyLen != RSAENH_3DES_STORAGE_KEYLEN) {
                SetLastError(NTE_BAD_FLAGS);
                return (HCRYPTKEY)INVALID_HANDLE_VALUE;
            }
            break;

        default:
            if (dwKeyLen % 8 || 
                dwKeyLen > peaAlgidInfo->dwMaxLen || 
                dwKeyLen < peaAlgidInfo->dwMinLen) 
            {
                SetLastError(NTE_BAD_FLAGS);
                return (HCRYPTKEY)INVALID_HANDLE_VALUE;
            }
    }
-----------
This is probably the end of the road of my analysis skills for this
issue...haha. Dunno if this helps anyone or not.


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list