Moderator: Jonny








Jonny wrote:It don't work very well though, as Safari refuses to download NZB files. It works if you open an NZB from mail though.
The dropbox app has an issue with NZB files as well, it downloads in and opens it in a text view. Then it refuses to acknowledge that any other app can open it. Seems like a bug in the Dropbox app.




HRESULT
CTCPServer::TC_CheckKey(const char* pszKey,const char* pszPassword,string_t& sEncoded)
{
if( !pszKey || !pszPassword )
{
ASSERT(0);
return(E_ABORT);
}
vect_uchar_t vKey;
vKey.insert(vKey.end(),pszKey,pszKey+strlen(pszKey));
vKey.push_back('|');
vKey.insert(vKey.end(),pszPassword,pszPassword+strlen(pszPassword));
byte KeyDest[32];
memset(KeyDest,0,sizeof(KeyDest));
CMD5HashBlock HasherSSL;
HasherSSL.HashInit();
HasherSSL.HashBlock((byte*)&vKey.front(),vKey.size(),KeyDest);
//Seems th
// 820b4ad02742e6630b554a48de7d2d9f
//
string_t sKey;
char pszOutput[32];
for( uint32_t nLoop = 0; nLoop < MD5_DIGEST_BYTES ; ++nLoop)
{
unsigned int cData = KeyDest[nLoop];
sprintf(pszOutput,"%02X",cData);
sKey += pszOutput;
}
ASSERT(sKey.size() == 32 );
std::transform(sKey.begin(),sKey.end(),sKey.begin(),toupper);
std::transform(sEncoded.begin(),sEncoded.end(),sEncoded.begin(),toupper);
if( sKey == sEncoded )
{
return(S_OK);
}
return(E_ABORT);
}




Quade wrote:The string "TEST|TEST" - no quotes
Generates this auth string
FD58E3D2B1E517F4EE46063AE176EEE1
It's got to be upper cased.











private void
OnConnect(object sender, EventArgs e)
{
int nResult = m_Command.ConnectServer(Properties.Settings.Default.IPAddress, int.Parse(Properties.Settings.Default.Port));
StatusList.Items.Add(new ListViewItem(m_Command.GetReplyString()));
if (480 == nResult)
{
String sResponse = m_Command.GetReplyString();
String[] Words = sResponse.Split(' ');
String sSalt = Words[5];
nResult = m_Command.AuthNew(Properties.Settings.Default.Password,sSalt);
StatusList.Items.Add(new ListViewItem(m_Command.GetReplyString()));
if (nResult < 0)
{
return;
}
}
bIsConnected = true;
....
public int AuthNew( String sPass,String sSalt)
{
StringBuilder sKeyBuilder = new StringBuilder();
sKeyBuilder.Append(sPass);
sKeyBuilder.Append(sSalt);
using (MD5 md5Hash = MD5.Create())
{
byte[] AsciiData = Encoding.ASCII.GetBytes(sKeyBuilder.ToString());
byte[] data = md5Hash.ComputeHash(AsciiData, 0, AsciiData.Length);
StringBuilder sBuilder = new StringBuilder();
sBuilder.Append("AUTH ");
for (int i = 0; i < data.Length; i++)
{
sBuilder.Append(data[i].ToString("X2"));
}
SendCommand(sBuilder);
}
ReadResponse();
Debug.Assert(m_nReplyCode < 299);
if (m_nReplyCode > 299)
{
}
return (m_nReplyCode);
}












Jonny wrote:No. Why would you want that?
Regards;
/jb







Quade wrote:I'll have to look into the download folder things.


Return to Newsbin Remote Control
Users browsing this forum: No registered users and 1 guest