~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzleclient/password.c

  • Committer: Brian Aker
  • Date: 2009-02-05 10:38:55 UTC
  • Revision ID: brian@tangent.org-20090205103855-wajzccrbu7zbvmh4
Reworked some classes out of session.h
Also updated ignore file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
           hash_stage2=sha1(hash_stage1)
49
49
           reply=xor(hash_stage1, sha1(public_seed,hash_stage2)
50
50
 
51
 
           // this three steps are done in scramble() 
 
51
           // this three steps are done in scramble()
52
52
 
53
53
           send(reply)
54
54
 
55
 
     
 
55
 
56
56
  SERVER:  recv(reply)
57
57
           hash_stage1=xor(reply, sha1(public_seed,hash_stage2))
58
58
           candidate_hash2=sha1(hash_stage1)
62
62
 
63
63
*****************************************************************************/
64
64
 
65
 
#include "libdrizzle.h"
66
65
#include "libdrizzle_priv.h"
 
66
#include "password.h"
 
67
 
67
68
#include <stdlib.h>
68
69
#include <string.h>
69
70
 
106
107
 
107
108
 
108
109
/*
109
 
    Generate binary hash from raw text string 
 
110
    Generate binary hash from raw text string
110
111
    Used for Pre-4.1 password handling
111
112
  SYNOPSIS
112
113
    hash_password()
164
165
}
165
166
 
166
167
 
167
 
/* Character to use as version identifier for version 4.1 */
168
 
 
169
 
#define PVERSION41_CHAR '*'
170
 
 
171
168
 
172
169
/*
173
170
    Convert given octet sequence to asciiz string of hex characters;
183
180
 
184
181
char *octet2hex(char *to, const char *str, uint32_t len)
185
182
{
186
 
  const char *str_end= str + len; 
 
183
  static const char _dig_vec_upper[]= "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 
184
 
 
185
  const char *str_end= str + len;
187
186
  for (; str != str_end; ++str)
188
187
  {
189
188
    *to++= _dig_vec_upper[((unsigned char) *str) >> 4];