Add optional two-factor authentication primitives
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
/****************************************************************************
|
||||
* <Novell-copyright>
|
||||
* Copyright (c) 2001 Novell, Inc. All Rights Reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of version 2 of the GNU General Public License
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, contact Novell, Inc.
|
||||
* </Novell-copyright>
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef BONGO_AUTH_SECURITY_H
|
||||
#define BONGO_AUTH_SECURITY_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <time.h>
|
||||
|
||||
#define BONGO_AUTH_TOTP_SECRET_SIZE 64
|
||||
#define BONGO_AUTH_CREDENTIAL_SIZE 48
|
||||
#define BONGO_AUTH_HASH_SIZE 128
|
||||
|
||||
int BongoAuthSecurityInit(void);
|
||||
void BongoAuthSecurityDone(void);
|
||||
int BongoAuthGenerateTotpSecret(char *result, size_t result_size);
|
||||
int BongoAuthVerifyTotp(const char *secret, const char *otp, time_t now);
|
||||
int BongoAuthGenerateCredential(char *result, size_t result_size);
|
||||
int BongoAuthHashCredential(const char *credential, char *result,
|
||||
size_t result_size);
|
||||
int BongoAuthVerifyCredential(const char *encoded, const char *credential);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user