3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
22 #include <glib/gprintf.h>
26 #include <sync_agent.h>
28 #include "password_generator.h"
30 #ifndef OMADM_AGENT_LOG
32 #define LOG_TAG "PLUGIN_DMACC_GCF"
37 /* general function */
38 // RSA ----------------------------------- gcf common - generate_password...
39 char *generate_device_password(const char *imei_device_id, const char *server_id, generate_type type)
44 retvm_if((imei_device_id) == NULL, 0, "imei_device_id is NULL!!");
45 retvm_if((server_id) == NULL, 0, "server_id is NULL!!");
47 char *password = NULL;
49 _DEBUG_INFO("imei_device_id = %s, server_id = %s\n", imei_device_id, server_id);
50 password = g_strdup_printf("%s_pw", server_id);
52 //// password generate ///
54 //////////////////////////
62 static void __print__array(char *array, int array_length, char *array_name)
64 _DEBUG_VERBOSE(" ====> Array Name : %s <===== \n", array_name);
66 for (i = 0; i < array_length; i++) {
67 _DEBUG_VERBOSE("index[ %d] = %X, ", i, array[i]);
68 if (i != 0 && 0 == (i % 8)) {