~ubuntu-branches/debian/squeeze/gnome-terminal/squeeze

« back to all changes in this revision

Viewing changes to src/skey/sha1.c

  • Committer: Bazaar Package Importer
  • Author(s): Josselin Mouette
  • Date: 2009-03-13 15:11:33 UTC
  • mfrom: (5.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090313151133-hszv8f99rmvlmvpk
Tags: 2.24.3-3
* Recommend gvfs. Closes: #519159.
* 01_tabs_shortcuts.patch: restore the ability to set shortcuts to 
  each tab. Closes: #519523.
* 02_tabs_shortcuts_translations.patch: restore translations from 
  version 2.22 for this functionality.
  + Thanks to Mart Raudsepp for preparing the patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 
15
15
#include <config.h>
16
16
 
 
17
#include <string.h>
17
18
#include <stdlib.h>
18
19
#include <arpa/inet.h>
19
20
 
20
 
#include <glib/gchecksum.h>
 
21
#include <glib.h>
21
22
 
22
23
#include "skey.h"
23
24
#include "skeyutil.h"
61
62
        guint32 *results;
62
63
 
63
64
        len = strlen(seed) + strlen(passphrase);
64
 
        if ((buf = (char *)malloc(len+1)) == NULL)
 
65
        if ((buf = (char *)g_try_malloc(len+1)) == NULL)
65
66
                return -1;
66
67
 
67
68
        strcpy(buf, seed);
71
72
 
72
73
        checksum = g_checksum_new (G_CHECKSUM_SHA1);
73
74
        g_checksum_update (checksum, (const guchar *) buf, len);
74
 
        free(buf);
 
75
        g_free(buf);
75
76
 
76
77
        g_checksum_get_digest (checksum, digest, &digest_len);
77
78
        g_assert (digest_len == 20);