@@ -102,20 +102,12 @@ static void delete_cached_crypto_keys() {
102102static binresult * get_userinfo_user_digest (
103103 psync_socket * sock , const char * username , size_t userlen ,
104104 const char * pwddig , const char * digest , uint32_t diglen ,
105- const char * osversion , const char * appversion , const char * deviceid ,
106105 const char * device ) {
107106 binparam params [] = {
108107 P_STR ("timeformat" , "timestamp" ),
109108 P_LSTR ("username" , username , userlen ),
110109 P_LSTR ("digest" , digest , diglen ),
111110 P_LSTR ("passworddigest" , pwddig , PSYNC_SHA1_DIGEST_HEXLEN ),
112- /* TODO: Sending the following params leads to PSTATUS_AUTH_BADLOGIN
113- * (possible the bug in the code or specific to API):
114- *
115- * P_STR("osversion", osversion),
116- * P_STR("appversion", appversion),
117- * P_STR("deviceid", deviceid),
118- */
119111 P_STR ("device" , device ),
120112 P_BOOL ("getauth" , 1 ),
121113 P_BOOL ("getapiserver" , 1 ),
@@ -128,7 +120,6 @@ static binresult *get_userinfo_user_digest(
128120
129121static binresult * get_userinfo_user_pass (
130122 psync_socket * sock , const char * username , const char * password ,
131- const char * osversion , const char * appversion , const char * deviceid ,
132123 const char * device ) {
133124 binparam empty_params [] = { P_STR ("MS" , "sucks" ) };
134125 psync_sha1_ctx ctx ;
@@ -170,9 +161,6 @@ static binresult *get_userinfo_user_pass(
170161 sha1hex ,
171162 dig -> str ,
172163 dig -> length ,
173- osversion ,
174- appversion ,
175- deviceid ,
176164 device
177165 );
178166 psync_free (res );
@@ -183,11 +171,8 @@ static psync_socket *get_connected_socket() {
183171 char * auth = NULL ;
184172 char * user = NULL ;
185173 char * pass = NULL ;
186- char * deviceid = NULL ;
187- char * osversion = NULL ;
188174 char * device = NULL ;
189175 char * command = NULL ;
190- const char * appversion ;
191176 psync_socket * sock ;
192177 binresult * res ;
193178 const binresult * cres ;
@@ -198,11 +183,8 @@ static psync_socket *get_connected_socket() {
198183 psync_is_business = 0 ;
199184 int digest = 1 ;
200185
201- deviceid = psync_get_device_id ();
202- log_info ("using deviceid: %s" , deviceid );
203-
204- appversion = psync_get_software_name ();
205186 device = psync_get_device_string ();
187+ log_info ("using device name: %s" , device );
206188
207189 while (1 ) {
208190 psync_free (auth );
@@ -233,18 +215,13 @@ static psync_socket *get_connected_socket() {
233215 continue ;
234216 }
235217
236- osversion = psync_get_os_name ();
237-
238218 if (user && pass && pass [0 ]) {
239219 if (digest ) {
240220 command = "digest" ;
241221 res = get_userinfo_user_pass (
242222 sock ,
243223 user ,
244224 pass ,
245- osversion ,
246- appversion ,
247- deviceid ,
248225 device
249226 );
250227 } else {
@@ -253,9 +230,6 @@ static psync_socket *get_connected_socket() {
253230 P_STR ("timeformat" , "timestamp" ),
254231 P_STR ("username" , user ),
255232 P_STR ("password" , pass ),
256- P_STR ("osversion" , osversion ),
257- P_STR ("appversion" , appversion ),
258- P_STR ("deviceid" , deviceid ),
259233 P_STR ("device" , device ),
260234 P_BOOL ("getauth" , 1 ),
261235 P_BOOL ("cryptokeyssign" , 1 ),
@@ -269,9 +243,6 @@ static psync_socket *get_connected_socket() {
269243 binparam params [] = {
270244 P_STR ("timeformat" , "timestamp" ),
271245 P_STR ("auth" , auth ),
272- P_STR ("osversion" , osversion ),
273- P_STR ("appversion" , appversion ),
274- P_STR ("deviceid" , deviceid ),
275246 P_STR ("device" , device ),
276247 P_BOOL ("getauth" , 1 ),
277248 P_BOOL ("cryptokeyssign" , 1 ),
@@ -281,8 +252,6 @@ static psync_socket *get_connected_socket() {
281252 res = send_command (sock , command , params );
282253 }
283254
284- psync_free (osversion );
285-
286255 if (unlikely_log (!res )) {
287256 psync_socket_close (sock );
288257 psync_set_status (PSTATUS_TYPE_ONLINE , PSTATUS_ONLINE_OFFLINE );
@@ -489,7 +458,6 @@ static psync_socket *get_connected_socket() {
489458 psync_free (auth );
490459 psync_free (user );
491460 psync_free (pass );
492- psync_free (deviceid );
493461 psync_free (device );
494462 psync_sql_sync ();
495463 return sock ;
0 commit comments