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