/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 
/* vim: set ts=2 et sw=2 tw=80: */
#if !defined(NET_FOSSIL_SCM_FSL_AUTH_H_INCLUDED)
#define NET_FOSSIL_SCM_FSL_AUTH_H_INCLUDED
/*
   Copyright (c) 2014 D. Richard Hipp

   This program is free software; you can redistribute it and/or
   modify it under the terms of the Simplified BSD License (also
   known as the "2-Clause License" or "FreeBSD License".)

   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.

   Author contact information:
     drh@hwaci.com
     http://www.hwaci.com/drh/

  ******************************************************************************
   This file declares public APIs for handling fossil authentication-related
   tasks.
*/

#include "fossil-core.h"
#include "fossil-hash.h"

#if defined(__cplusplus)
extern "C" {
#endif

    /**
       If f has an opened repository, this function forms a hash from:

       "ProjectCode/zLoginName/zPw"

       (without the quotes)

       where ProjectCode is a repository-instance-dependent series of
       random bytes. The returned string is owned by the caller, who
       must eventually fsl_free() it. The project code is stored in
       the repository's config table under the key 'project-code', and
       this routine fetches that key if necessary.

       Potential TODO:

       - in fossil(1), this function generates a different result (it
       returns a copy of zPw) if the project code is not set, under
       the assumption that this is "the first xfer request of a
       clone."  Whether or not that will apply at this level to
       libfossil remains to be seen.
     */
    char * fsl_sha1_shared_secret( fsl_cx * f, char const * zPw, char const * zLoginName );

#if defined(__cplusplus)
} /*extern "C"*/
#endif
#endif
/* NET_FOSSIL_SCM_FSL_AUTH_H_INCLUDED */
