gchar*
formhistory_encrypt (const gchar* input,
- unsigned char* key)
+ const gchar* key)
{
int outlen=0, auxlen=0;
EVP_CIPHER_CTX ctx;
memset (&buff[0], '\0', BUF_SIZE);
EVP_CIPHER_CTX_init (&ctx);
- EVP_EncryptInit (&ctx, EVP_bf_cbc (), key, (unsigned char*)iv);
+ EVP_EncryptInit (&ctx, EVP_bf_cbc (), (unsigned char*)key, (unsigned char*)iv);
if (EVP_EncryptUpdate (&ctx, (uc*)&buff, &outlen, (uc*)input, inputSize) != 1)
return NULL;
gchar*
formhistory_decrypt (const gchar* b64input,
- unsigned char* key)
+ const gchar* key)
{
int outlen=0, auxlen=0;
EVP_CIPHER_CTX ctx;
memset (&buff, 0, BUF_SIZE);
EVP_CIPHER_CTX_init (& ctx);
- EVP_DecryptInit (& ctx, EVP_bf_cbc(), key, (uc*)iv);
+ EVP_DecryptInit (& ctx, EVP_bf_cbc(), (unsigned char*)key, (uc*)iv);
if (EVP_DecryptUpdate (& ctx, (uc*)&buff, &outlen, (uc*)input, inputSize) != 1)
return NULL;
} FormhistoryPasswordEntry;
gchar*
-formhistory_encrypt (const gchar* input, unsigned char* key);
+formhistory_encrypt (const gchar* input, const gchar* key);
gchar*
-formhistory_decrypt (const gchar* b64input, unsigned char* key);
+formhistory_decrypt (const gchar* b64input, const char* key);
#endif
#else
gchar* jsforms;
#endif
- unsigned char master_password [MAXPASSSIZE];
+ gchar* master_password;
int master_password_canceled;
int password_manager_enabled;
} FormHistoryPriv;
const gchar* title;
static int alive;
gboolean ret = FALSE;
- unsigned char* master_password;
- master_password = priv->master_password;
/* Password is set */
- if (master_password[0] && master_password[1])
+ if (priv->master_password && *priv->master_password)
return TRUE;
/* Other prompt is active */
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK)
{
/* FIXME: add password verification */
- memset (&master_password[0], '\0', MAXPASSSIZE);
- strcpy ((char*)master_password, gtk_entry_get_text (GTK_ENTRY (entry)));
+ katze_assign (priv->master_password,
+ g_strdup (gtk_entry_get_text (GTK_ENTRY (entry))));
ret = TRUE;
}
else
FormHistoryPriv* priv;
priv = formhistory_private_new ();
- strcpy ((char*)priv->master_password, "");
+ priv->master_password = NULL;
priv->master_password_canceled = 0;
priv->password_manager_enabled = 1;
formhistory_construct_popup_gui (priv);