| 203 |
203 |
| 204 if ((g_stat(file_public_key, &st)) == -1) { |
204 if ((g_stat(file_public_key, &st)) == -1) { |
| 205 /* If file doesn't exist */ |
205 /* If file doesn't exist */ |
| 206 if (errno == ENOENT) { |
206 if (errno == ENOENT) { |
| 207 gaim_connection_update_progress(gc, _("Creating SILC key pair..."), 1, 5); |
207 gaim_connection_update_progress(gc, _("Creating SILC key pair..."), 1, 5); |
| 208 silc_create_key_pair(SILCGAIM_DEF_PKCS, |
208 if (!silc_create_key_pair(SILCGAIM_DEF_PKCS, |
| 209 SILCGAIM_DEF_PKCS_LEN, |
209 SILCGAIM_DEF_PKCS_LEN, |
| 210 file_public_key, file_private_key, NULL, |
210 file_public_key, file_private_key, NULL, |
| 211 (gc->password == NULL) ? "" : gc->password, |
211 (gc->password == NULL) ? "" : gc->password, |
| 212 NULL, NULL, NULL, FALSE); |
212 NULL, NULL, NULL, FALSE)) { |
| 213 g_stat(file_public_key, &st); |
213 gaim_debug_error("silc", "Couldn't create key pair\n"); |
| |
214 return FALSE; |
| |
215 } |
| |
216 |
| |
217 if ((g_stat(file_public_key, &st)) == -1) { |
| |
218 gaim_debug_error("silc", "Couldn't stat '%s' public key, error: %s\n", |
| |
219 file_public_key, strerror(errno)); |
| |
220 return FALSE; |
| |
221 } |
| 214 } else { |
222 } else { |
| 215 gaim_debug_error("silc", "Couldn't stat '%s' public key, error: %s\n", |
223 gaim_debug_error("silc", "Couldn't stat '%s' public key, error: %s\n", |
| 216 file_public_key, strerror(errno)); |
224 file_public_key, strerror(errno)); |
| 217 return FALSE; |
225 return FALSE; |
| 218 } |
226 } |