insecure.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /* Null security operations.
  2. *
  3. * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. #include <net/af_rxrpc.h>
  12. #include "ar-internal.h"
  13. static int none_init_connection_security(struct rxrpc_connection *conn)
  14. {
  15. return 0;
  16. }
  17. static int none_prime_packet_security(struct rxrpc_connection *conn)
  18. {
  19. return 0;
  20. }
  21. static int none_secure_packet(struct rxrpc_call *call,
  22. struct sk_buff *skb,
  23. size_t data_size,
  24. void *sechdr)
  25. {
  26. return 0;
  27. }
  28. static int none_verify_packet(struct rxrpc_call *call,
  29. struct sk_buff *skb,
  30. u32 *_abort_code)
  31. {
  32. return 0;
  33. }
  34. static int none_respond_to_challenge(struct rxrpc_connection *conn,
  35. struct sk_buff *skb,
  36. u32 *_abort_code)
  37. {
  38. *_abort_code = RX_PROTOCOL_ERROR;
  39. return -EPROTO;
  40. }
  41. static int none_verify_response(struct rxrpc_connection *conn,
  42. struct sk_buff *skb,
  43. u32 *_abort_code)
  44. {
  45. *_abort_code = RX_PROTOCOL_ERROR;
  46. return -EPROTO;
  47. }
  48. static void none_clear(struct rxrpc_connection *conn)
  49. {
  50. }
  51. static int none_init(void)
  52. {
  53. return 0;
  54. }
  55. static void none_exit(void)
  56. {
  57. }
  58. /*
  59. * RxRPC Kerberos-based security
  60. */
  61. const struct rxrpc_security rxrpc_no_security = {
  62. .name = "none",
  63. .security_index = RXRPC_SECURITY_NONE,
  64. .init = none_init,
  65. .exit = none_exit,
  66. .init_connection_security = none_init_connection_security,
  67. .prime_packet_security = none_prime_packet_security,
  68. .secure_packet = none_secure_packet,
  69. .verify_packet = none_verify_packet,
  70. .respond_to_challenge = none_respond_to_challenge,
  71. .verify_response = none_verify_response,
  72. .clear = none_clear,
  73. };