mirror of
https://github.com/strophe/libstrophe.git
synced 2026-07-24 06:26:20 +00:00
It has been pointed out that the wording of the license of this library is not entirely clear. The term "dual licensing" usually refers to a licence choice of two licenses "LICENSE1 _or_ LICENSE2. Instead the license of this library claimed "LICENSE1 _and_ LICENSE2". After an internal discussion with @metajack and @pasis it was made clear that the initial idea was to dual license the library in the usual way. This was also made clear by jack on the ML in the past [0]. As of jack, these licensing terms originated from jquery, which also used the 'and' version in the past and has since been corrected [1]. This patch changes the license terms to 'MIT or GPLv3' and also adds SPDX headers [2]. [0] https://groups.google.com/g/libstrophe/c/JkFgr601JQc [1] https://stackoverflow.com/q/2758409 [2] https://spdx.org Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
61 lines
1.8 KiB
C
61 lines
1.8 KiB
C
/* SPDX-License-Identifier: MIT OR GPL-3.0-only */
|
|
/* scram.h
|
|
* strophe XMPP client library -- SCRAM helper functions
|
|
*
|
|
* Copyright (C) 2013 Dmitry Podgorny <pasis.ua@gmail.com>
|
|
*
|
|
* This software is provided AS-IS with no warranty, either express
|
|
* or implied.
|
|
*
|
|
* This program is dual licensed under the MIT or GPLv3 licenses.
|
|
*/
|
|
|
|
/** @file
|
|
* SCRAM helper functions.
|
|
*/
|
|
|
|
#ifndef __LIBSTROPHE_SCRAM_H__
|
|
#define __LIBSTROPHE_SCRAM_H__
|
|
|
|
/* make sure the stdint.h types are available */
|
|
#include "ostypes.h"
|
|
|
|
/* Maximum possible digest size. Used for buffers allocation. */
|
|
#include "sha512.h"
|
|
#define SCRAM_DIGEST_SIZE SHA512_DIGEST_SIZE
|
|
|
|
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 *);
|
|
};
|
|
|
|
extern const struct hash_alg scram_sha1;
|
|
extern const struct hash_alg scram_sha256;
|
|
extern const struct hash_alg scram_sha512;
|
|
|
|
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_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__ */
|