/[gpgoe]/trunk/src/OEPassphraseCBDlg.c
ViewVC logotype

Diff of /trunk/src/OEPassphraseCBDlg.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 23 by twoaday, Sat Aug 18 10:55:14 2007 UTC revision 24 by twoaday, Tue Dec 13 10:40:30 2011 UTC
# Line 37  struct pass_cb_s { Line 37  struct pass_cb_s {
37    
38    
39  /* Reference to the passphrase cache. */  /* Reference to the passphrase cache. */
40  extern char gpgoe_pass_cache[HASH_BUCKETS][256];  extern char gpgoe_pass_cache[HASH_BUCKETS][MAX_PASS_LEN];
41    
42    
43  DWORD hash_string (const char *str_param);  DWORD hash_string (const char *str_param);
# Line 45  DWORD hash_string (const char *str_param Line 45  DWORD hash_string (const char *str_param
45  /* Store the passphrase @pass in the hash table using the keyid @keyid  /* Store the passphrase @pass in the hash table using the keyid @keyid
46     as the index. */     as the index. */
47  static void  static void
48  passphrase_put (char ctx[HASH_BUCKETS][256], const char *keyid, const char *pass)  passphrase_put (char ctx[HASH_BUCKETS][MAX_PASS_LEN], const char *keyid,
49                    const char *pass)              
50  {  {
51      int pos = hash_string (keyid) % HASH_BUCKETS;      int pos = hash_string (keyid) % HASH_BUCKETS;
52      int n, passlen;      int n, passlen;
53    
54      /* We cannot store passphrase of that size. */      /* We cannot store passphrase of that size. */
55      passlen = strlen (pass);      passlen = strlen (pass);
56      if (passlen > 255)      if (passlen > MAX_PASS_LEN-1)
57          return;          return;
58            
59      n = 0;      n = 0;
# Line 72  passphrase_put (char ctx[HASH_BUCKETS][2 Line 73  passphrase_put (char ctx[HASH_BUCKETS][2
73     using the keyid @keyid as the index. Or NULL if there is     using the keyid @keyid as the index. Or NULL if there is
74     no stored passphrase. */     no stored passphrase. */
75  static const char*  static const char*
76  passphrase_get (char ctx[HASH_BUCKETS][256], const char *keyid)  passphrase_get (char ctx[HASH_BUCKETS][MAX_PASS_LEN], const char *keyid)
77  {  {
78      const char *item;      const char *item;
79      int pos = hash_string (keyid) % HASH_BUCKETS;      int pos = hash_string (keyid) % HASH_BUCKETS;

Legend:
Removed from v.23  
changed lines
  Added in v.24

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26