void handleSubCmd(struct Key k) { uint8_t type=PH_TYPE_ALNUMSYM; uint8_t len=12; char password[PH_MAX_LEN+1]; uint8_t ret; switch( subcmd ) { case SUB_MACRO: setMacroMode(true); activateMacro(k.row*ROWS+k.col); setCommandMode(false); break; case SUB_MACRO_REC: setMacroRecording(1+k.row*ROWS+k.col); setCommandMode(false); break; case SUB_PASSHASH: ret = passHash(password, len, type, "secret", "key", "tag"); printf("\nPH len=%d type=%d = %s", len, type, password); setCommandMode(false); break; default: setCommandMode(false); break; } clearActiveKeys(); clearRowData(); }
void clientMd5Login::setPassword(const QString &pass, const QString &authKey) { QByteArray hashPassword; hashPassword.append(pass); QByteArray authkey; authkey.append(authKey); QByteArray AIM_MD5_STRING("AOL Instant Messenger (SM)"); QCryptographicHash passHash(QCryptographicHash::Md5); passHash.addData(authkey); passHash.addData(hashPassword); passHash.addData(AIM_MD5_STRING); password.setData(passHash.result()); }