Source code pulled from OpenBSD for OpenNTPD. The place to contribute to this code is via the OpenBSD CVS tree.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
3.7 KiB

24 years ago
  1. /* $OpenBSD: bsd_auth.h,v 1.9 2006/01/06 18:53:04 millert Exp $ */
  2. /*-
  3. * Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. All advertising materials mentioning features or use of this software
  14. * must display the following acknowledgement:
  15. * This product includes software developed by Berkeley Software Design,
  16. * Inc.
  17. * 4. The name of Berkeley Software Design, Inc. may not be used to endorse
  18. * or promote products derived from this software without specific prior
  19. * written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY BERKELEY SOFTWARE DESIGN, INC. ``AS IS'' AND
  22. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24. * ARE DISCLAIMED. IN NO EVENT SHALL BERKELEY SOFTWARE DESIGN, INC. BE LIABLE
  25. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31. * SUCH DAMAGE.
  32. *
  33. * BSDI $From: bsd_auth.h,v 2.3 1999/09/08 22:13:08 prb Exp $
  34. */
  35. #ifndef _BSD_AUTH_H_
  36. #define _BSD_AUTH_H_
  37. #include <machine/_types.h> /* for __va_list */
  38. typedef struct auth_session_t auth_session_t;
  39. typedef enum {
  40. AUTHV_ALL,
  41. AUTHV_CHALLENGE,
  42. AUTHV_CLASS,
  43. AUTHV_NAME,
  44. AUTHV_SERVICE,
  45. AUTHV_STYLE,
  46. AUTHV_INTERACTIVE
  47. } auth_item_t;
  48. #include <sys/cdefs.h>
  49. __BEGIN_DECLS
  50. struct passwd;
  51. struct login_cap;
  52. char *auth_getitem(auth_session_t *, auth_item_t);
  53. int auth_setitem(auth_session_t *, auth_item_t, char *);
  54. auth_session_t *auth_open(void);
  55. auth_session_t *auth_verify(auth_session_t *, char *, char *, ...)
  56. __attribute__((sentinel));
  57. auth_session_t *auth_userchallenge(char *, char *, char *, char **);
  58. auth_session_t *auth_usercheck(char *, char *, char *, char *);
  59. int auth_userresponse(auth_session_t *, char *, int);
  60. int auth_userokay(char *, char *, char *, char *);
  61. int auth_approval(auth_session_t *, struct login_cap *, char *, char *);
  62. int auth_close(auth_session_t *);
  63. void auth_clean(auth_session_t *);
  64. char *auth_getvalue(auth_session_t *, char *);
  65. int auth_getstate(auth_session_t *);
  66. char *auth_challenge(auth_session_t *);
  67. void auth_setenv(auth_session_t *);
  68. void auth_clrenv(auth_session_t *);
  69. void auth_setstate(auth_session_t *, int);
  70. int auth_call(auth_session_t *, char *, ...)
  71. __attribute__((sentinel));
  72. int auth_setdata(auth_session_t *, void *, size_t);
  73. int auth_setoption(auth_session_t *, char *, char *);
  74. int auth_setpwd(auth_session_t *, struct passwd *pwd);
  75. void auth_set_va_list(auth_session_t *, __va_list);
  76. struct passwd *auth_getpwd(auth_session_t *);
  77. quad_t auth_check_expire(auth_session_t *);
  78. quad_t auth_check_change(auth_session_t *);
  79. void auth_clroptions(auth_session_t *);
  80. void auth_clroption(auth_session_t *, char *);
  81. char *auth_mkvalue(char *);
  82. void auth_checknologin(struct login_cap *);
  83. int auth_cat(char *);
  84. __END_DECLS
  85. #endif /* _BSD_AUTH_H_ */