re-factor SCRAM to be independent of the hash
This commit is contained in:
committed by
Dmitry Podgorny
parent
2ca2fcfedd
commit
fc064bc883
41
src/scram.h
41
src/scram.h
@@ -19,22 +19,35 @@
|
||||
/* make sure the stdint.h types are available */
|
||||
#include "ostypes.h"
|
||||
|
||||
#include "sha1.h"
|
||||
struct hash_alg {
|
||||
const char *scram_name;
|
||||
int mask;
|
||||
size_t digest_size;
|
||||
void (*hash)(const uint8_t *, size_t, uint8_t *);
|
||||
void (*init)(void *);
|
||||
void (*update)(void *, const uint8_t *, size_t);
|
||||
void (*final)(void *, uint8_t *);
|
||||
};
|
||||
|
||||
void SCRAM_SHA1_ClientKey(const uint8_t *password,
|
||||
size_t len,
|
||||
const uint8_t *salt,
|
||||
size_t salt_len,
|
||||
uint32_t i,
|
||||
uint8_t *key);
|
||||
extern const struct hash_alg scram_sha1;
|
||||
|
||||
void SCRAM_SHA1_ClientSignature(const uint8_t *ClientKey,
|
||||
const uint8_t *AuthMessage,
|
||||
size_t len,
|
||||
uint8_t *sign);
|
||||
void SCRAM_ClientKey(const struct hash_alg *alg,
|
||||
const uint8_t *password,
|
||||
size_t len,
|
||||
const uint8_t *salt,
|
||||
size_t salt_len,
|
||||
uint32_t i,
|
||||
uint8_t *key);
|
||||
|
||||
void SCRAM_SHA1_ClientProof(const uint8_t *ClientKey,
|
||||
const uint8_t *ClientSignature,
|
||||
uint8_t *proof);
|
||||
void SCRAM_ClientSignature(const struct hash_alg *alg,
|
||||
const uint8_t *ClientKey,
|
||||
const uint8_t *AuthMessage,
|
||||
size_t len,
|
||||
uint8_t *sign);
|
||||
|
||||
void SCRAM_ClientProof(const struct hash_alg *alg,
|
||||
const uint8_t *ClientKey,
|
||||
const uint8_t *ClientSignature,
|
||||
uint8_t *proof);
|
||||
|
||||
#endif /* __LIBSTROPHE_SCRAM_H__ */
|
||||
|
||||
Reference in New Issue
Block a user