libpurple/protocols/mxit/cipher.c

changeset 31958
e1b3f14fba94
parent 29106
51c7b2177e42
child 31999
8654d04cb094
child 33559
94a95ba03c78
equal deleted inserted replaced
31957:be5a056fa36d 31958:e1b3f14fba94
82 memset( exkey, 0x00, sizeof( exkey ) ); 82 memset( exkey, 0x00, sizeof( exkey ) );
83 memset( pass, 0x58, sizeof( pass ) ); 83 memset( pass, 0x58, sizeof( pass ) );
84 pass[sizeof( pass ) - 1] = '\0'; 84 pass[sizeof( pass ) - 1] = '\0';
85 85
86 /* build the custom AES encryption key */ 86 /* build the custom AES encryption key */
87 strcpy( key, INITIAL_KEY ); 87 g_strlcpy( key, INITIAL_KEY, sizeof( key ) );
88 memcpy( key, session->clientkey, strlen( session->clientkey ) ); 88 memcpy( key, session->clientkey, strlen( session->clientkey ) );
89 ExpandKey( (unsigned char*) key, (unsigned char*) exkey ); 89 ExpandKey( (unsigned char*) key, (unsigned char*) exkey );
90 90
91 /* build the custom data to be encrypted */ 91 /* build the custom data to be encrypted */
92 strcpy( pass, SECRET_HEADER ); 92 g_strlcpy( pass, SECRET_HEADER, sizeof( pass ) );
93 strcat( pass, session->acc->password ); 93 strcat( pass, session->acc->password );
94 94
95 /* pad the secret data */ 95 /* pad the secret data */
96 blocks = pad_secret_data( pass ); 96 blocks = pad_secret_data( pass );
97 size = blocks * 16; 97 size = blocks * 16;

mercurial