deployd/server/include/auth.h
Arija A. d878187ccd
Begin work on client
Signed-off-by: Arija A. <ari@ari.lt>
2025-07-24 02:38:50 +03:00

26 lines
934 B
C

#ifndef DEPLOYD_AUTH_H_
#define DEPLOYD_AUTH_H_
#include "conf.h"
#include "def.h"
#include "blake2s.h"
#define DP_AUTH_SECRET_SIZE 24
#define DP_AUTH_KEY_SIZE 32
#define DP_AUTH_TOKEN_SIZE 16
bool dp_auth_gen_token(uint8_t out[DP_AUTH_TOKEN_SIZE],
uint64_t timestamp,
const uint8_t secret_key[DP_AUTH_SECRET_SIZE]);
bool dp_auth_gen_secret(uint8_t secret[DP_AUTH_SECRET_SIZE],
uint8_t key[DP_AUTH_KEY_SIZE],
uint64_t *timestamp);
bool dp_auth_verify_token(const uint8_t secret[DP_AUTH_SECRET_SIZE],
uint64_t timestamp,
const uint8_t given_token[DP_AUTH_SECRET_SIZE]);
bool dp_auth_verify_key(const uint8_t key[DP_AUTH_SECRET_SIZE],
uint64_t timestamp,
const uint8_t given_token[DP_AUTH_SECRET_SIZE]);
#endif /* DEPLOYD_AUTH_H_ */