LPSTR __cdecl pgp_encrypt(pCNTX ptr, LPCSTR szPlainMsg) { ptr->error = ERROR_NONE; mir_free(ptr->tmp); pPGPDATA p = (pPGPDATA)ptr->pdata; LPSTR szEncMsg = (p->pgpKey ? p_pgp_encrypt_key(szPlainMsg, (LPCSTR)p->pgpKey) : p_pgp_encrypt_keydb(szPlainMsg, p->pgpKeyID)); if (!szEncMsg) { return ptr->tmp = 0; } else { ptr->tmp = mir_strdup(szEncMsg); LocalFree((LPVOID)szEncMsg); return ptr->tmp; } }
LPSTR __cdecl pgp_encrypt(pCNTX ptr, LPCSTR szPlainMsg) { ptr->error = ERROR_NONE; pPGPDATA p = (pPGPDATA) ptr->pdata; SAFE_FREE(ptr->tmp); LPSTR szEncMsg; if(p->pgpKey) szEncMsg = p_pgp_encrypt_key(szPlainMsg,(LPCSTR)p->pgpKey); else szEncMsg = p_pgp_encrypt_keydb(szPlainMsg,p->pgpKeyID); if(!szEncMsg) return 0; ptr->tmp = (LPSTR) strdup(szEncMsg); LocalFree((LPVOID)szEncMsg); return ptr->tmp; }