Changeset 21 in chevmsgr
- Timestamp:
- 11/28/15 17:02:54 (8 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/crypto.cpp
r13 r21 4 4 5 5 #define ARIA_BLOCKSIZE 16 6 7 static cf::bin getPaddingBytes(int blockSize, int inputSize) 8 { 9 int paddingSize = blockSize - (inputSize % blockSize); 10 cf::bin result; 11 12 result.resize(paddingSize); 13 14 memset(result.buffer(), paddingSize, paddingSize); 15 16 return result; 17 } 6 18 7 19 crypto::crypto() … … 58 70 return out; 59 71 } 60 61 cf::bin crypto::getPaddingBytes(int blockSize, int inputSize)62 {63 int paddingSize = blockSize - (inputSize % blockSize);64 cf::bin result;65 66 result.resize(paddingSize);67 68 memset(result.buffer(), paddingSize, paddingSize);69 70 return result;71 } -
trunk/crypto.h
r7 r21 19 19 20 20 cf::bin decrypt(cf::bin & input); 21 22 cf::bin getPaddingBytes(int blockSize, int inputSize);23 21 }; -
trunk/msgsrv.cpp
r20 r21 310 310 static std::string generateSMSCode() 311 311 { 312 return "545454"; 312 313 char random[8] = {0x00,}; 313 314 sprintf(random, "%06d", generateSeed() % 1000000); … … 349 350 crypt.setKey(cf::bin(sms + DELIMITER + random)); 350 351 351 std::string auth = crypt.decrypt(cf:: bin(secret)).toString();352 std::string auth = crypt.decrypt(cf::codec::hex::getInstance()->decode(secret)).toString(); 352 353 353 354 if (auth[0] != '{')
Note:
See TracChangeset
for help on using the changeset viewer.