]> arthur.barton.de Git - netatalk.git/blob - etc/uams/uams_dhx2_passwd.c
libgcrypt and DHX2 uam from Frank Lahm
[netatalk.git] / etc / uams / uams_dhx2_passwd.c
1 /*
2  * $Id: uams_dhx2_passwd.c,v 1.1 2008-11-22 12:07:26 didg 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  * libgcrpyt 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: %u", 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, int ibuflen _U_,
166                       char *rbuf, int *rbuflen)
167 {
168     int i, ret;
169
170     unsigned int g_uint;
171     gcry_mpi_t g, Ma;
172     char *Ra_binary = NULL;
173     gcry_cipher_hd_t ctx;
174     gcry_error_t ctxerror;
175
176     const int g_len = 4;
177     size_t len;
178     size_t nwritten;
179 #ifdef SHADOWPW
180     struct spwd *sp;
181 #endif /* SHADOWPW */
182     *rbuflen = 0;
183
184     /* Initialize passwd/shadow */
185 #ifdef SHADOWPW
186     if (( sp = getspnam( dhxpwd->pw_name )) == NULL ) {
187         LOG(log_info, logtype_uams, "no shadow passwd entry for this user");
188         return AFPERR_NOTAUTH;
189     }
190     dhxpwd->pw_passwd = sp->sp_pwdp;
191 #endif /* SHADOWPW */
192
193     if (!dhxpwd->pw_passwd)
194         return AFPERR_NOTAUTH;
195
196     /* Initialize DH params */
197
198     p = gcry_mpi_new(0);
199     g = gcry_mpi_new(0);
200     Ra = gcry_mpi_new(0);
201     Ma = gcry_mpi_new(0);
202
203     /* Generate p and g for DH */
204     ret = dh_params_generate( &p, &g, PRIMEBITS);
205     if (ret != 0) {
206         LOG(log_info, logtype_uams, "DHX2: Couldn't generate p and g");
207         ret = AFPERR_MISC;
208         goto error;
209     }
210
211     /* Generate our random number Ra. */
212     Ra_binary = calloc(1, PRIMEBITS/8);
213     if (Ra_binary == NULL) {
214         ret = AFPERR_MISC;
215         goto error;
216     }
217     gcry_randomize(Ra_binary, PRIMEBITS/8, GCRY_STRONG_RANDOM);
218     gcry_mpi_scan(&Ra, GCRYMPI_FMT_USG, Ra_binary, PRIMEBITS/8, NULL);
219     free(Ra_binary);
220     Ra_binary = NULL;
221
222     /* Ma = g^Ra mod p. This is our "public" key */
223     gcry_mpi_powm(Ma, g, Ra, p);
224
225     /* ------- DH Init done ------ */
226     /* Start building reply packet */
227
228     /* Session ID first */
229     ID = dhxhash(obj);
230     *(u_int16_t *)rbuf = htons(ID);
231     rbuf += 2;
232     *rbuflen += 2;
233
234     /* g is next */
235     gcry_mpi_print( GCRYMPI_FMT_USG, rbuf, 4, &nwritten, g);
236     if (nwritten < 4) {
237         memmove( rbuf+4-nwritten, rbuf, nwritten);
238         memset( rbuf, 0, 4-nwritten);
239     }
240     rbuf += 4;
241     *rbuflen += 4;
242
243     /* len = length of p = PRIMEBITS/8 */
244     *(u_int16_t *)rbuf = htons((u_int16_t) PRIMEBITS/8);
245     rbuf += 2;
246     *rbuflen += 2;
247
248     /* p */
249     gcry_mpi_print( GCRYMPI_FMT_USG, rbuf, PRIMEBITS/8, NULL, p);
250     rbuf += PRIMEBITS/8;
251     *rbuflen += PRIMEBITS/8;
252
253     /* Ma */
254     gcry_mpi_print( GCRYMPI_FMT_USG, rbuf, PRIMEBITS/8, &len, Ma);
255     if (len < PRIMEBITS/8) {
256         memmove(rbuf + (PRIMEBITS/8) - len, rbuf, len);
257         memset(rbuf, 0, (PRIMEBITS/8) - len);
258     }
259     rbuf += PRIMEBITS/8;
260     *rbuflen += PRIMEBITS/8;
261
262     ret = AFPERR_AUTHCONT;
263
264 error:                          /* We exit here anyway */
265     /* We will only need p and Ra later, but mustn't forget to release it ! */
266     gcry_mpi_release(g);
267     gcry_mpi_release(Ma);
268     return ret;
269 }
270
271 /* -------------------------------- */
272 static int login(void *obj, char *username, int ulen,  struct passwd **uam_pwd _U_,
273                  char *ibuf, int ibuflen,
274                  char *rbuf, int *rbuflen)
275 {
276     if (( dhxpwd = uam_getname(obj, username, ulen)) == NULL ) {
277         LOG(log_info, logtype_uams, "DHX2: unknown username");
278         return AFPERR_PARAM;
279     }
280
281     LOG(log_info, logtype_uams, "DHX2 login: %s", username);
282     return dhx2_setup(obj, ibuf, ibuflen, rbuf, rbuflen);
283 }
284
285 /* -------------------------------- */
286 /* dhx login: things are done in a slightly bizarre order to avoid
287  * having to clean things up if there's an error. */
288 static int passwd_login(void *obj, struct passwd **uam_pwd,
289                      char *ibuf, int ibuflen,
290                      char *rbuf, int *rbuflen)
291 {
292     char *username;
293     int len, ulen;
294
295     *rbuflen = 0;
296
297     /* grab some of the options */
298     if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &ulen) < 0) {
299         LOG(log_info, logtype_uams, "DHX2: uam_afpserver_option didn't meet uam_option_username  -- %s",
300             strerror(errno));
301         return AFPERR_PARAM;
302     }
303
304     len = (unsigned char) *ibuf++;
305     if ( len > ulen ) {
306         LOG(log_info, logtype_uams, "DHX2: Signature Retieval Failure -- %s",
307             strerror(errno));
308         return AFPERR_PARAM;
309     }
310
311     memcpy(username, ibuf, len );
312     ibuf += len;
313     username[ len ] = '\0';
314
315     if ((unsigned long) ibuf & 1) /* pad to even boundary */
316         ++ibuf;
317
318     return (login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen));
319 }
320
321 /* ----------------------------- */
322 static int passwd_login_ext(void *obj, char *uname, struct passwd **uam_pwd,
323                          char *ibuf, int ibuflen,
324                          char *rbuf, int *rbuflen)
325 {
326     char *username;
327     int len, ulen;
328     u_int16_t  temp16;
329
330     *rbuflen = 0;
331
332     /* grab some of the options */
333     if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &ulen) < 0) {
334         LOG(log_info, logtype_uams, "DHX2: uam_afpserver_option didn't meet uam_option_username  -- %s",
335             strerror(errno));
336         return AFPERR_PARAM;
337     }
338
339     if (*uname != 3)
340         return AFPERR_PARAM;
341     uname++;
342     memcpy(&temp16, uname, sizeof(temp16));
343     len = ntohs(temp16);
344
345     if ( !len || len > ulen ) {
346         LOG(log_info, logtype_uams, "DHX2: Signature Retrieval Failure -- %s",
347             strerror(errno));
348         return AFPERR_PARAM;
349     }
350     memcpy(username, uname +2, len );
351     username[ len ] = '\0';
352
353     return (login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen));
354 }
355
356 /* -------------------------------- */
357
358 static int logincont1(void *obj, struct passwd **uam_pwd,
359                          char *ibuf, int ibuflen,
360                          char *rbuf, int *rbuflen)
361 {
362     u_int16_t retID;
363     size_t nwritten;
364     int ret;
365     *rbuflen = 0;
366
367     gcry_mpi_t Mb, K, clientNonce;
368     char *K_bin = NULL;
369     char serverNonce_bin[16];
370     gcry_cipher_hd_t ctx;
371     gcry_error_t ctxerror;
372
373     Mb = gcry_mpi_new(0);
374     K = gcry_mpi_new(0);
375     clientNonce = gcry_mpi_new(0);
376     serverNonce = gcry_mpi_new(0);
377
378     /* Packet size should be: Session ID + Ma + Encrypted client nonce */
379     if (ibuflen != 2 + PRIMEBITS/8 + 16) {
380         LOG(log_error, logtype_uams, "DHX2: Paket length not correct");
381         ret = AFPERR_PARAM;
382         goto error_noctx;
383     }
384
385     /* Skip session id */
386     ibuf += 2;
387
388     /* Extract Mb, client's "public" key */
389     gcry_mpi_scan(&Mb, GCRYMPI_FMT_USG, ibuf, PRIMEBITS/8, NULL);
390     ibuf += PRIMEBITS/8;
391
392     /* Now finally generate the Key: K = Mb^Ra mod p */
393     gcry_mpi_powm(K, Mb, Ra, p);
394
395     /* We need K in binary form in order to ... */
396     K_bin = calloc(1, PRIMEBITS/8);
397     if (K_bin == NULL) {
398         ret = AFPERR_MISC;
399         goto error_noctx;
400     }
401     gcry_mpi_print(GCRYMPI_FMT_USG, K_bin, PRIMEBITS/8, &nwritten, K);
402     if (nwritten < PRIMEBITS/8) {
403         memmove(K_bin + PRIMEBITS/8 - nwritten, K_bin, nwritten);
404         memset(K_bin, 0, PRIMEBITS/8 - nwritten);
405     }
406
407     /* ... generate the MD5 hash of K. K_MD5hash is what we actually use ! */
408     K_MD5hash = calloc(1, K_hash_len = gcry_md_get_algo_dlen(GCRY_MD_MD5));
409     if (K_MD5hash == NULL) {
410         ret = AFPERR_MISC;
411         goto error_noctx;
412     }
413     gcry_md_hash_buffer(GCRY_MD_MD5, K_MD5hash, K_bin, PRIMEBITS/8);
414     free(K_bin); 
415     K_bin = NULL; 
416
417     /* FIXME: To support the Reconnect UAM, we need to store this key somewhere */
418
419     /* Set up our encryption context. */
420     ctxerror = gcry_cipher_open( &ctx, GCRY_CIPHER_CAST5, GCRY_CIPHER_MODE_CBC, 0);
421     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
422         ret = AFPERR_MISC;
423         goto error_ctx;
424     }
425     /* Set key */
426     ctxerror = gcry_cipher_setkey(ctx, K_MD5hash, K_hash_len);
427     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
428         ret = AFPERR_MISC;
429         goto error_ctx;
430     }
431     /* Set the initialization vector for client->server transfer. */
432     ctxerror = gcry_cipher_setiv(ctx, dhx_c2siv, sizeof(dhx_c2siv));
433     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
434         ret = AFPERR_MISC;
435         goto error_ctx;
436     }
437     /* Finally: decrypt client's md5_K(client nonce, C2SIV) inplace */
438     ctxerror = gcry_cipher_decrypt(ctx, ibuf, 16, NULL, 0);
439     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
440         ret = AFPERR_MISC;
441         goto error_ctx;
442     }
443     /* Pull out clients nonce */
444     gcry_mpi_scan(&clientNonce, GCRYMPI_FMT_USG, ibuf, 16, NULL);
445     /* Increment nonce */
446     gcry_mpi_add_ui(clientNonce, clientNonce, 1);
447
448     /* Generate our nonce and remember it for Logincont2 */
449     gcry_create_nonce(serverNonce_bin, 16); /* We'll use this here */
450     gcry_mpi_scan(&serverNonce, GCRYMPI_FMT_USG, serverNonce_bin, 16, NULL); /* For use in Logincont2 */
451
452     /* ---- Start building reply packet ---- */
453
454     /* Session ID + 1 first */
455     *(u_int16_t *)rbuf = htons(ID+1);
456     rbuf += 2;
457     *rbuflen += 2;
458
459     /* Client nonce + 1 */
460     gcry_mpi_print(GCRYMPI_FMT_USG, rbuf, PRIMEBITS/8, NULL, clientNonce);
461     /* Server nonce */
462     memcpy(rbuf+16, serverNonce_bin, 16);
463
464     /* Set the initialization vector for server->client transfer. */
465     ctxerror = gcry_cipher_setiv(ctx, dhx_s2civ, sizeof(dhx_s2civ));
466     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
467         ret = AFPERR_MISC;
468         goto error_ctx;
469     }
470     /* Encrypt md5_K(clientNonce+1, serverNonce) inplace */
471     ctxerror = gcry_cipher_encrypt(ctx, rbuf, 32, NULL, 0);
472     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
473         ret = AFPERR_MISC;
474         goto error_ctx;
475     }
476     rbuf += 32;
477     *rbuflen += 32;
478
479     ret = AFPERR_AUTHCONT;
480     goto exit;
481
482 error_ctx:
483     gcry_cipher_close(ctx);
484 error_noctx:
485     gcry_mpi_release(serverNonce);
486     free(K_MD5hash);
487     K_MD5hash=NULL;
488 exit:
489     gcry_mpi_release(K);
490     gcry_mpi_release(Mb);
491     gcry_mpi_release(Ra);
492     gcry_mpi_release(p);
493     gcry_mpi_release(clientNonce);
494     return ret;
495 }
496
497 static int logincont2(void *obj, struct passwd **uam_pwd,
498                       char *ibuf, int ibuflen,
499                       char *rbuf, int *rbuflen)
500 {
501 #ifdef SHADOWPW
502     struct spwd *sp;
503 #endif /* SHADOWPW */
504     size_t nwritten;
505     int ret;
506     char *p;
507     *rbuflen = 0;
508     gcry_mpi_t retServerNonce;
509     gcry_cipher_hd_t ctx;
510     gcry_error_t ctxerror;
511
512     /* Packet size should be: Session ID + ServerNonce + Passwd buffer */
513     if (ibuflen != 2 + 16 + 256) {
514         LOG(log_error, logtype_uams, "DHX2: Paket length not correct");
515         ret = AFPERR_PARAM;
516         goto error_noctx;
517     }
518
519     retServerNonce = gcry_mpi_new(0);
520
521     /* Set up our encryption context. */
522     ctxerror = gcry_cipher_open( &ctx, GCRY_CIPHER_CAST5, GCRY_CIPHER_MODE_CBC, 0);
523     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
524         ret = AFPERR_MISC;
525         goto error_ctx;
526     }
527     /* Set key */
528     ctxerror = gcry_cipher_setkey(ctx, K_MD5hash, K_hash_len);
529     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
530         ret = AFPERR_MISC;
531         goto error_ctx;
532     }
533     /* Set the initialization vector for client->server transfer. */
534     ctxerror = gcry_cipher_setiv(ctx, dhx_c2siv, sizeof(dhx_c2siv));
535     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
536         ret = AFPERR_MISC;
537         goto error_ctx;
538     }
539
540     /* Skip Session ID */
541     ibuf += 2;
542
543     /* Finally: decrypt client's md5_K(serverNonce+1, passwor, C2SIV) inplace */
544     ctxerror = gcry_cipher_decrypt(ctx, ibuf, 16+256, NULL, 0);
545     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {
546         ret = AFPERR_MISC;
547         goto error_ctx;
548     }
549     /* Pull out nonce. Should be serverNonce+1 */
550     gcry_mpi_scan(&retServerNonce, GCRYMPI_FMT_USG, ibuf, 16, NULL);
551     gcry_mpi_sub_ui(retServerNonce, retServerNonce, 1);
552     if ( gcry_mpi_cmp( serverNonce, retServerNonce) != 0) {
553         /* We're hacked!  */
554         ret = AFPERR_NOTAUTH;
555         goto error_ctx;
556     }
557     ibuf += 16;                 /* ibuf now point to passwd in cleartext */
558
559     /* ---- Start authentication --- */
560     ret = AFPERR_NOTAUTH;
561
562     p = crypt( ibuf, dhxpwd->pw_passwd );
563     memset(ibuf, 0, 255);
564     if ( strcmp( p, dhxpwd->pw_passwd ) == 0 ) {
565         *uam_pwd = dhxpwd;
566         ret = AFP_OK;
567     }
568
569 #ifdef SHADOWPW
570     if (( sp = getspnam( dhxpwd->pw_name )) == NULL ) {
571         LOG(log_info, logtype_uams, "no shadow passwd entry for %s", dhxpwd->pw_name);
572         ret = AFPERR_NOTAUTH;
573         goto exit;
574     }
575
576     /* check for expired password */
577     if (sp && sp->sp_max != -1 && sp->sp_lstchg) {
578         time_t now = time(NULL) / (60*60*24);
579         int32_t expire_days = sp->sp_lstchg - now + sp->sp_max;
580         if ( expire_days < 0 ) {
581             LOG(log_info, logtype_uams, "password for user %s expired", dhxpwd->pw_name);
582             ret = AFPERR_PWDEXPR;
583             goto exit;
584         }
585     }
586 #endif /* SHADOWPW */
587
588 error_ctx:
589     gcry_cipher_close(ctx);
590 error_noctx:
591 exit:
592     free(K_MD5hash);
593     K_MD5hash=NULL;
594     gcry_mpi_release(serverNonce);
595     gcry_mpi_release(retServerNonce);
596     return ret;
597 }
598
599 static int passwd_logincont(void *obj, struct passwd **uam_pwd,
600                          char *ibuf, int ibuflen,
601                          char *rbuf, int *rbuflen)
602 {
603     u_int16_t retID;
604     int ret;
605
606     /* check for session id */
607     retID = ntohs(*(u_int16_t *)ibuf);
608     if (retID == ID)
609         ret = logincont1(obj, uam_pwd, ibuf, ibuflen, rbuf, rbuflen);
610     else if (retID == ID+1)
611         ret = logincont2(obj, uam_pwd, ibuf,ibuflen, rbuf, rbuflen);
612     else {
613         LOG(log_info, logtype_uams, "DHX2: Session ID Mismatch");
614         ret = AFPERR_PARAM;
615     }
616     return ret;
617 }
618
619 static int uam_setup(const char *path)
620 {
621     if (uam_register(UAM_SERVER_LOGIN_EXT, path, "DHX2", passwd_login,
622                      passwd_logincont, NULL, passwd_login_ext) < 0)
623         return -1;
624     return 0;
625 }
626
627 static void uam_cleanup(void)
628 {
629     uam_unregister(UAM_SERVER_LOGIN, "DHX2");
630 }
631
632
633 UAM_MODULE_EXPORT struct uam_export uams_dhx2 = {
634     UAM_MODULE_SERVER,
635     UAM_MODULE_VERSION,
636     uam_setup, uam_cleanup
637 };
638
639
640 UAM_MODULE_EXPORT struct uam_export uams_dhx2_pam = {
641     UAM_MODULE_SERVER,
642     UAM_MODULE_VERSION,
643     uam_setup, uam_cleanup
644 };
645
646 #endif /* UAM_DHX2 */
647