Changeset 21 in chevmsgr


Ignore:
Timestamp:
11/28/15 17:02:54 (8 years ago)
Author:
cheese
Message:

서버 메시지 디코딩 하지 않던 문제 수정

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/crypto.cpp

    r13 r21  
    44
    55#define ARIA_BLOCKSIZE  16
     6
     7static 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}
    618
    719crypto::crypto()
     
    5870    return out;
    5971}
    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  
    1919
    2020    cf::bin decrypt(cf::bin & input);
    21 
    22     cf::bin getPaddingBytes(int blockSize, int inputSize);
    2321};
  • trunk/msgsrv.cpp

    r20 r21  
    310310static std::string generateSMSCode()
    311311{
     312    return "545454";
    312313    char random[8] = {0x00,};
    313314    sprintf(random, "%06d", generateSeed() % 1000000);
     
    349350    crypt.setKey(cf::bin(sms + DELIMITER + random));
    350351
    351     std::string auth = crypt.decrypt(cf::bin(secret)).toString();
     352    std::string auth = crypt.decrypt(cf::codec::hex::getInstance()->decode(secret)).toString();
    352353
    353354    if (auth[0] != '{')
Note: See TracChangeset for help on using the changeset viewer.