Writed in C++/Qt, used the example of a wiki but always comes "!trap cannot login"
For example http://wiki.mikrotik.com/wiki/Manual:API#Initial_login - what password used here to get such a hash?
That's how I make a hash:
Code: Select all
std::string md5ChallengeBinary = MD5ToBinary(challenge.toStdString());
std::string stdpass = m_password.toStdString();
QCryptographicHash hash(QCryptographicHash::Md5);
hash.addData("\0");
hash.addData(stdpass.c_str(), stdpass.length());
hash.addData(md5ChallengeBinary.c_str(), md5ChallengeBinary.length());
QString md5PasswordToSend = hash.result().toHex();
WriteWord("/login");
WriteWord("=name=" + m_login);
WriteWord("=response=00" + md5PasswordToSend);
WriteWord("\0");