]> arthur.barton.de Git - netatalk.git/blob - etc/uams/uams_dhx2_passwd.c
Merge branch 'release-3-0-1'
[netatalk.git] / etc / uams / uams_dhx2_passwd.c
1 /*
2  * $Id: uams_dhx2_passwd.c,v 1.8 2010-03-30 10:25:49 franklahm Exp $
3  *
4  * Copyright (c) 1990,1993 Regents of The University of Michigan.
5  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
6  * All Rights Reserved.  See COPYRIGHT.
7  */
8
9 #ifdef HAVE_CONFIG_H
10 #include "config.h"
11 #endif /* HAVE_CONFIG_H */
12
13 #ifdef UAM_DHX2
14
15 #include <atalk/standards.h>
16
17 #include <stdio.h>
18 #include <stdlib.h>
19 #include <string.h>
20 #include <errno.h>
21 #include <pwd.h>
22 #include <arpa/inet.h>
23 #include <unistd.h>
24
25 #ifdef HAVE_CRYPT_H
26 #include <crypt.h>
27 #endif
28
29 #include <sys/time.h>
30 #include <time.h>
31
32 #ifdef SHADOWPW
33 #include <shadow.h>
34 #endif
35
36 #ifdef HAVE_LIBGCRYPT
37 #include <gcrypt.h>
38 #endif
39
40 #include <atalk/afp.h>
41 #include <atalk/uam.h>
42 #include <atalk/logger.h>
43
44 /* Number of bits for p which we generate. Everybode out there uses 512, so we beet them */
45 #define PRIMEBITS 1024
46
47 /* hash a number to a 16-bit quantity */
48 #define dhxhash(a) ((((unsigned long) (a) >> 8) ^   \
49                      (unsigned long) (a)) & 0xffff)
50
51 /* Some parameters need be maintained across calls */
52 static gcry_mpi_t p, Ra;
53 static gcry_mpi_t serverNonce;
54 static char *K_MD5hash = NULL;
55 static int K_hash_len;
56 static uint16_t ID;
57
58 /* The initialization vectors for CAST128 are fixed by Apple. */
59 static unsigned char dhx_c2siv[] = { 'L', 'W', 'a', 'l', 'l', 'a', 'c', 'e' };
60 static unsigned char dhx_s2civ[] = { 'C', 'J', 'a', 'l', 'b', 'e', 'r', 't' };
61
62 /* Static variables used to communicate between the conversation function
63  * and the server_login function */
64 static struct passwd *dhxpwd;
65
66 /*********************************************************
67  * Crypto helper func to generate p and g for use in DH.
68  * libgcrypt doesn't provide one directly.
69  * Algorithm taken from GNUTLS:gnutls_dh_primes.c
70  *********************************************************/
71
72 /**
73  * This function will generate a new pair of prime and generator for use in
74  * the Diffie-Hellman key exchange.
75  * The bits value should be one of 768, 1024, 2048, 3072 or 4096.
76  **/
77
78 static int
79 dh_params_generate (gcry_mpi_t *ret_p, gcry_mpi_t *ret_g, unsigned int bits) {
80
81     int result, times = 0, qbits;
82
83     gcry_mpi_t g = NULL, prime = NULL;
84     gcry_mpi_t *factors = NULL;
85     gcry_error_t err;
86
87     /* Version check should be the very first call because it
88        makes sure that important subsystems are intialized. */
89     if (!gcry_check_version (GCRYPT_VERSION)) {
90         LOG(log_info, logtype_uams, "PAM DHX2: libgcrypt versions mismatch. Need: %s", GCRYPT_VERSION);
91         result = AFPERR_MISC;
92         goto error;
93     }
94
95     if (bits < 256)
96         qbits = bits / 2;
97     else
98         qbits = (bits / 40) + 105;
99
100     if (qbits & 1) /* better have an even number */
101         qbits++;
102
103     /* find a prime number of size bits. */
104     do {
105         if (times) {
106             gcry_mpi_release (prime);
107             gcry_prime_release_factors (factors);
108         }
109         err = gcry_prime_generate (&prime, bits, qbits, &factors, NULL, NULL,
110                                    GCRY_STRONG_RANDOM, GCRY_PRIME_FLAG_SPECIAL_FACTOR);
111         if (err != 0) {
112             result = AFPERR_MISC;
113             goto error;
114         }
115         err = gcry_prime_check (prime, 0);
116         times++;
117     } while (err != 0 && times < 10);
118
119     if (err != 0) {
120         result = AFPERR_MISC;
121         goto error;
122     }
123
124     /* generate the group generator. */
125     err = gcry_prime_group_generator (&g, prime, factors, NULL);
126     if (err != 0) {
127         result = AFPERR_MISC;
128         goto error;
129     }
130
131     gcry_prime_release_factors (factors);
132     factors = NULL;
133
134     if (ret_g)
135         *ret_g = g;
136     else
137         gcry_mpi_release (g);
138     if (ret_p)
139         *ret_p = prime;
140     else
141         gcry_mpi_release (prime);
142
143     return 0;
144
145 error:
146     gcry_prime_release_factors (factors);
147     gcry_mpi_release (g);
148     gcry_mpi_release (prime);
149
150     return result;
151 }
152
153 static int dhx2_setup(void *obj, char *ibuf _U_, size_t ibuflen _U_,
154                       char *rbuf, size_t *rbuflen)
155 {
156     int ret;
157     size_t nwritten;
158     gcry_mpi_t g, Ma;
159     char *Ra_binary = NULL;
160 #ifdef SHADOWPW
161     struct spwd *sp;
162 #endif /* SHADOWPW */
163     uint16_t uint16;
164
165     *rbuflen = 0;
166
167     /* Initialize passwd/shadow */
168 #ifdef SHADOWPW
169     if (( sp = getspnam( dhxpwd->pw_name )) == NULL ) {
170         LOG(log_info, logtype_uams, "DHX2: no shadow passwd entry for this user");
171         return AFPERR_NOTAUTH;
172     }
173     dhxpwd->pw_passwd = sp->sp_pwdp;
174 #endif /* SHADOWPW */
175
176     if (!dhxpwd->pw_passwd)
177         return AFPERR_NOTAUTH;
178
179     /* Initialize DH params */
180
181     p = gcry_mpi_new(0);
182     g = gcry_mpi_new(0);
183     Ra = gcry_mpi_new(0);
184     Ma = gcry_mpi_new(0);
185
186     /* Generate p and g for DH */
187     ret = dh_params_generate( &p, &g, PRIMEBITS);
188     if (ret != 0) {
189         LOG(log_info, logtype_uams, "DHX2: Couldn't generate p and g");
190         ret = AFPERR_MISC;
191         goto error;
192     }
193
194     /* Generate our random number Ra. */
195     Ra_binary = calloc(1, PRIMEBITS/8);
196     if (Ra_binary == NULL) {
197         ret = AFPERR_MISC;
198         goto error;
199     }
200     gcry_randomize(Ra_binary, PRIMEBITS/8, GCRY_STRONG_RANDOM);
201     gcry_mpi_scan(&Ra, GCRYMPI_FMT_USG, Ra_binary, PRIMEBITS/8, NULL);
202     free(Ra_binary);
203     Ra_binary = NULL;
204
205     /* Ma = g^Ra mod p. This is our "public" key */
206     gcry_mpi_powm(Ma, g, Ra, p);
207
208     /* ------- DH Init done ------ */
209     /* Start building reply packet */
210
211     /* Session ID first */
212     ID = dhxhash(obj);
213     uint16 = htons(ID);
214     memcpy(rbuf, &uint16, sizeof(uint16_t));
215     rbuf += 2;
216     *rbuflen += 2;
217
218     /* g is next */
219     gcry_mpi_print( GCRYMPI_FMT_USG, (unsigned char *)rbuf, 4, &nwritten, g);
220     if (nwritten < 4) {
221         memmove( rbuf+4-nwritten, rbuf, nwritten);
222         memset( rbuf, 0, 4-nwritten);
223     }
224     rbuf += 4;
225     *rbuflen += 4;
226
227     /* len = length of p = PRIMEBITS/8 */
228     uint16 = htons((uint16_t) PRIMEBITS/8);
229     memcpy(rbuf, &uint16, sizeof(uint16_t));
230     rbuf += 2;
231     *rbuflen += 2;
232
233     /* p */
234     gcry_mpi_print( GCRYMPI_FMT_USG, (unsigned char *)rbuf, PRIMEBITS/8, NULL, p);
235     rbuf += PRIMEBITS/8;
236     *rbuflen += PRIMEBITS/8;
237
238     /* Ma */
239     gcry_mpi_print( GCRYMPI_FMT_USG, (unsigned char *)rbuf, PRIMEBITS/8, &nwritten, Ma);
240     if (nwritten < PRIMEBITS/8) {
241         memmove(rbuf + (PRIMEBITS/8) - nwritten, rbuf, nwritten);
242         memset(rbuf, 0, (PRIMEBITS/8) - nwritten);
243     }
244     rbuf += PRIMEBITS/8;
245     *rbuflen += PRIMEBITS/8;
246
247     ret = AFPERR_AUTHCONT;
248
249 error:              /* We exit here anyway */
250     /* We will only need p and Ra later, but mustn't forget to release it ! */
251     gcry_mpi_release(g);
252     gcry_mpi_release(Ma);
253     return ret;
254 }
255
256 /* -------------------------------- */
257 static int login(void *obj, char *username, int ulen,  struct passwd **uam_pwd _U_,
258                  char *ibuf, size_t ibuflen,
259                  char *rbuf, size_t *rbuflen)
260 {
261     if (( dhxpwd = uam_getname(obj, username, ulen)) == NULL ) {
262         LOG(log_info, logtype_uams, "DHX2: unknown username");
263         return AFPERR_NOTAUTH;
264     }
265
266     LOG(log_info, logtype_uams, "DHX2 login: %s", username);
267     return dhx2_setup(obj, ibuf, ibuflen, rbuf, rbuflen);
268 }
269
270 /* -------------------------------- */
271 /* dhx login: things are done in a slightly bizarre order to avoid
272  * having to clean things up if there's an error. */
273 static int passwd_login(void *obj, struct passwd **uam_pwd,
274                         char *ibuf, size_t ibuflen,
275                         char *rbuf, size_t *rbuflen)
276 {
277     char *username;
278     size_t len, ulen;
279
280     *rbuflen = 0;
281
282     /* grab some of the options */
283     if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &ulen) < 0) {
284         LOG(log_info, logtype_uams, "DHX2: uam_afpserver_option didn't meet uam_option_username  -- %s",
285             strerror(errno));
286         return AFPERR_PARAM;
287     }
288
289     len = (unsigned char) *ibuf++;
290     if ( len > ulen ) {
291         LOG(log_info, logtype_uams, "DHX2: Signature Retieval Failure -- %s",
292             strerror(errno));
293         return AFPERR_PARAM;
294     }
295
296     memcpy(username, ibuf, len );
297     ibuf += len;
298     username[ len ] = '\0';
299
300     if ((unsigned long) ibuf & 1) /* pad to even boundary */
301         ++ibuf;
302
303     return (login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen));
304 }
305
306 /* ----------------------------- */
307 static int passwd_login_ext(void *obj, char *uname, struct passwd **uam_pwd,
308                             char *ibuf, size_t ibuflen,
309                             char *rbuf, size_t *rbuflen)
310 {
311     char *username;
312     size_t len, ulen;
313     uint16_t  temp16;
314
315     *rbuflen = 0;
316
317     /* grab some of the options */
318     if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &ulen) < 0) {
319         LOG(log_info, logtype_uams, "DHX2: uam_afpserver_option didn't meet uam_option_username  -- %s",
320             strerror(errno));
321         return AFPERR_PARAM;
322     }
323
324     if (*uname != 3)
325         return AFPERR_PARAM;
326     uname++;
327     memcpy(&temp16, uname, sizeof(temp16));
328     len = ntohs(temp16);
329
330     if ( !len || len > ulen ) {
331         LOG(log_info, logtype_uams, "DHX2: Signature Retrieval Failure -- %s",
332             strerror(errno));
333         return AFPERR_PARAM;
334     }
335     memcpy(username, uname +2, len );
336     username[ len ] = '\0';
337
338     return (login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen));
339 }
340
341 /* -------------------------------- */
342
343 static int logincont1(void *obj _U_, struct passwd **uam_pwd _U_,
344                       char *ibuf, size_t ibuflen,
345                       char *rbuf, size_t *rbuflen)
346 {
347     size_t nwritten;
348     int ret;
349     gcry_mpi_t Mb, K, clientNonce;
350     unsigned char *K_bin = NULL;
351     char serverNonce_bin[16];
352     gcry_cipher_hd_t ctx;
353     gcry_error_t ctxerror;
354     uint16_t uint16;
355
356     *rbuflen = 0;
357
358     Mb = gcry_mpi_new(0);
359     K = gcry_mpi_new(0);
360     clientNonce = gcry_mpi_new(0);
361     serverNonce = gcry_mpi_new(0);
362
363     /* Packet size should be: Session ID + Ma + Encrypted client nonce */
364     if (ibuflen != 2 + PRIMEBITS/8 + 16) {
365         LOG(log_error, logtype_uams, "DHX2: Paket length not correct");
366         ret = AFPERR_PARAM;
367         goto error_noctx;
368     }
369
370     /* Skip session id */
371     ibuf += 2;
372
373     /* Extract Mb, client's "public" key */
374     gcry_mpi_scan(&Mb, GCRYMPI_FMT_USG, ibuf, PRIMEBITS/8, NULL);
375     ibuf += PRIMEBITS/8;
376
377     /* Now finally generate the Key: K = Mb^Ra mod p */
378     gcry_mpi_powm(K, Mb, Ra, p);
379
380     /* We need K in binary form in order to ... */
381     K_bin = calloc(1, PRIMEBITS/8);
382     if (K_bin == NULL) {
383         ret = AFPERR_MISC;
384         goto error_noctx;
385     }
386     gcry_mpi_print(GCRYMPI_FMT_USG, K_bin, PRIMEBITS/8, &nwritten, K);
387     if (nwritten < PRIMEBITS/8) {
388         memmove(K_bin + PRIMEBITS/8 - nwritten, K_bin, nwritten);
389         memset(K_bin, 0, PRIMEBITS/8 - nwritten);
390     }
391
392     /* ... generate the MD5 hash of K. K_MD5hash is what we actually use ! */
393     K_MD5hash = calloc(1, K_hash_len = gcry_md_get_algo_dlen(GCRY_MD_MD5));
394     if (K_MD5hash == NULL) {
395         ret = AFPERR_MISC;
396         free(K_bin);
397         K_bin = NULL;
398         goto error_noctx;
399     }
400     gcry_md_hash_buffer(GCRY_MD_MD5, K_MD5hash, K_bin, PRIMEBITS/8);
401     free(K_bin);
402     K_bin = NULL;
403
404     /* FIXME: To support the Reconnect UAM, we need to store this key somewhere */
405
406     /* Set up our encryption context. */
407     ctxerror = gcry_cipher_open( &ctx, GCRY_CIPHER_CAST5, GCRY_CIPHER_MODE_CBC, 0);
408     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
409         ret = AFPERR_MISC;
410         goto error_ctx;
411     }
412     /* Set key */
413     ctxerror = gcry_cipher_setkey(ctx, K_MD5hash, K_hash_len);
414     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
415         ret = AFPERR_MISC;
416         goto error_ctx;
417     }
418     /* Set the initialization vector for client->server transfer. */
419     ctxerror = gcry_cipher_setiv(ctx, dhx_c2siv, sizeof(dhx_c2siv));
420     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
421         ret = AFPERR_MISC;
422         goto error_ctx;
423     }
424     /* Finally: decrypt client's md5_K(client nonce, C2SIV) inplace */
425     ctxerror = gcry_cipher_decrypt(ctx, ibuf, 16, NULL, 0);
426     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
427         ret = AFPERR_MISC;
428         goto error_ctx;
429     }
430     /* Pull out clients nonce */
431     gcry_mpi_scan(&clientNonce, GCRYMPI_FMT_USG, ibuf, 16, NULL);
432     /* Increment nonce */
433     gcry_mpi_add_ui(clientNonce, clientNonce, 1);
434
435     /* Generate our nonce and remember it for Logincont2 */
436     gcry_create_nonce(serverNonce_bin, 16); /* We'll use this here */
437     gcry_mpi_scan(&serverNonce, GCRYMPI_FMT_USG, serverNonce_bin, 16, NULL); /* For use in Logincont2 */
438
439     /* ---- Start building reply packet ---- */
440
441     /* Session ID + 1 first */
442     uint16 = htons(ID+1);
443     memcpy(rbuf, &uint16, sizeof(uint16_t));
444     rbuf += 2;
445     *rbuflen += 2;
446
447     /* Client nonce + 1 */
448     gcry_mpi_print(GCRYMPI_FMT_USG, (unsigned char *)rbuf, PRIMEBITS/8, NULL, clientNonce);
449     /* Server nonce */
450     memcpy(rbuf+16, serverNonce_bin, 16);
451
452     /* Set the initialization vector for server->client transfer. */
453     ctxerror = gcry_cipher_setiv(ctx, dhx_s2civ, sizeof(dhx_s2civ));
454     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
455         ret = AFPERR_MISC;
456         goto error_ctx;
457     }
458     /* Encrypt md5_K(clientNonce+1, serverNonce) inplace */
459     ctxerror = gcry_cipher_encrypt(ctx, rbuf, 32, NULL, 0);
460     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
461         ret = AFPERR_MISC;
462         goto error_ctx;
463     }
464     rbuf += 32;
465     *rbuflen += 32;
466
467     ret = AFPERR_AUTHCONT;
468     goto exit;
469
470 error_ctx:
471     gcry_cipher_close(ctx);
472 error_noctx:
473     gcry_mpi_release(serverNonce);
474     free(K_MD5hash);
475     K_MD5hash=NULL;
476 exit:
477     gcry_mpi_release(K);
478     gcry_mpi_release(Mb);
479     gcry_mpi_release(Ra);
480     gcry_mpi_release(p);
481     gcry_mpi_release(clientNonce);
482     return ret;
483 }
484
485 static int logincont2(void *obj _U_, struct passwd **uam_pwd,
486                       char *ibuf, size_t ibuflen,
487                       char *rbuf _U_, size_t *rbuflen)
488 {
489 #ifdef SHADOWPW
490     struct spwd *sp;
491 #endif /* SHADOWPW */
492     int ret;
493     char *p;
494     gcry_mpi_t retServerNonce;
495     gcry_cipher_hd_t ctx;
496     gcry_error_t ctxerror;
497
498     *rbuflen = 0;
499     retServerNonce = gcry_mpi_new(0);
500
501     /* Packet size should be: Session ID + ServerNonce + Passwd buffer (evantually +10 extra bytes, see Apples Docs)*/
502     if ((ibuflen != 2 + 16 + 256) && (ibuflen != 2 + 16 + 256 + 10)) {
503         LOG(log_error, logtype_uams, "DHX2: Paket length not correct: %d. Should be 274 or 284.", ibuflen);
504         ret = AFPERR_PARAM;
505         goto error_noctx;
506     }
507
508     /* Set up our encryption context. */
509     ctxerror = gcry_cipher_open( &ctx, GCRY_CIPHER_CAST5, GCRY_CIPHER_MODE_CBC, 0);
510     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
511         ret = AFPERR_MISC;
512         goto error_ctx;
513     }
514     /* Set key */
515     ctxerror = gcry_cipher_setkey(ctx, K_MD5hash, K_hash_len);
516     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
517         ret = AFPERR_MISC;
518         goto error_ctx;
519     }
520     /* Set the initialization vector for client->server transfer. */
521     ctxerror = gcry_cipher_setiv(ctx, dhx_c2siv, sizeof(dhx_c2siv));
522     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
523         ret = AFPERR_MISC;
524         goto error_ctx;
525     }
526
527     /* Skip Session ID */
528     ibuf += 2;
529
530     /* Finally: decrypt client's md5_K(serverNonce+1, passwor, C2SIV) inplace */
531     ctxerror = gcry_cipher_decrypt(ctx, ibuf, 16+256, NULL, 0);
532     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
533         ret = AFPERR_MISC;
534         goto error_ctx;
535     }
536     /* Pull out nonce. Should be serverNonce+1 */
537     gcry_mpi_scan(&retServerNonce, GCRYMPI_FMT_USG, ibuf, 16, NULL);
538     gcry_mpi_sub_ui(retServerNonce, retServerNonce, 1);
539     if ( gcry_mpi_cmp( serverNonce, retServerNonce) != 0) {
540         /* We're hacked!  */
541         ret = AFPERR_NOTAUTH;
542         goto error_ctx;
543     }
544     ibuf += 16;         /* ibuf now point to passwd in cleartext */
545
546     /* ---- Start authentication --- */
547     ret = AFPERR_NOTAUTH;
548
549     p = crypt( ibuf, dhxpwd->pw_passwd );
550     memset(ibuf, 0, 255);
551     if ( strcmp( p, dhxpwd->pw_passwd ) == 0 ) {
552         *uam_pwd = dhxpwd;
553         ret = AFP_OK;
554     }
555
556 #ifdef SHADOWPW
557     if (( sp = getspnam( dhxpwd->pw_name )) == NULL ) {
558         LOG(log_info, logtype_uams, "no shadow passwd entry for %s", dhxpwd->pw_name);
559         ret = AFPERR_NOTAUTH;
560         goto exit;
561     }
562
563     /* check for expired password */
564     if (sp && sp->sp_max != -1 && sp->sp_lstchg) {
565         time_t now = time(NULL) / (60*60*24);
566         int32_t expire_days = sp->sp_lstchg - now + sp->sp_max;
567         if ( expire_days < 0 ) {
568             LOG(log_info, logtype_uams, "password for user %s expired", dhxpwd->pw_name);
569             ret = AFPERR_PWDEXPR;
570             goto exit;
571         }
572     }
573 #endif /* SHADOWPW */
574
575 error_ctx:
576     gcry_cipher_close(ctx);
577 error_noctx:
578 exit:
579     free(K_MD5hash);
580     K_MD5hash=NULL;
581     gcry_mpi_release(serverNonce);
582     gcry_mpi_release(retServerNonce);
583     return ret;
584 }
585
586 static int passwd_logincont(void *obj, struct passwd **uam_pwd,
587                             char *ibuf, size_t ibuflen,
588                             char *rbuf, size_t *rbuflen)
589 {
590     uint16_t retID;
591     int ret;
592
593     /* check for session id */
594     memcpy(&retID, ibuf, sizeof(uint16_t));
595     retID = ntohs(retID);
596     if (retID == ID)
597         ret = logincont1(obj, uam_pwd, ibuf, ibuflen, rbuf, rbuflen);
598     else if (retID == ID+1)
599         ret = logincont2(obj, uam_pwd, ibuf,ibuflen, rbuf, rbuflen);
600     else {
601         LOG(log_info, logtype_uams, "DHX2: Session ID Mismatch");
602         ret = AFPERR_PARAM;
603     }
604     return ret;
605 }
606
607 static int uam_setup(const char *path)
608 {
609     if (uam_register(UAM_SERVER_LOGIN_EXT, path, "DHX2", passwd_login,
610                      passwd_logincont, NULL, passwd_login_ext) < 0)
611         return -1;
612     return 0;
613 }
614
615 static void uam_cleanup(void)
616 {
617     uam_unregister(UAM_SERVER_LOGIN, "DHX2");
618 }
619
620
621 UAM_MODULE_EXPORT struct uam_export uams_dhx2 = {
622     UAM_MODULE_SERVER,
623     UAM_MODULE_VERSION,
624     uam_setup, uam_cleanup
625 };
626
627
628 UAM_MODULE_EXPORT struct uam_export uams_dhx2_passwd = {
629     UAM_MODULE_SERVER,
630     UAM_MODULE_VERSION,
631     uam_setup, uam_cleanup
632 };
633
634 #endif /* UAM_DHX2 */
635