lorauth.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. babeld-lor
  3. Copyright (C) 2017 Rodrigo Garcia
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. */
  15. #define LORAUTH_TOKENS_DIR "tokens"
  16. #define LORAUTH_TOKENS_FILE "ciphered-tokens.ctxt"
  17. #define LORAUTH_CIPHER_LEN 512
  18. //extern unsigned char mylorauth_cipher[LORAUTH_CIPHER_LEN+1];
  19. int lorauth_token(unsigned char *dest, unsigned char id[8],
  20. unsigned short seqno);
  21. int lorauth_token_index(unsigned char id[8], unsigned short seqno);
  22. int check_lorauth_token(unsigned char id[8],
  23. unsigned char prefix[16],
  24. unsigned short seqno,
  25. unsigned short clen,
  26. unsigned char *cipher);
  27. const char* reduced_lorauth_token(const unsigned char *token);
  28. void clean_cipher(unsigned char *buffered_cipher);