Apache HTTPD
Classes | Macros | Typedefs | Functions | Variables
apr_sha1.h File Reference

APR-UTIL SHA1 library. More...

#include "apu.h"
#include "apr_general.h"

Go to the source code of this file.

Classes

struct  apr_sha1_ctx_t
 

Macros

#define APR_SHA1_DIGESTSIZE   20
 
#define APR_SHA1PW_ID   "{SHA}"
 
#define APR_SHA1PW_IDLEN   5
 

Typedefs

typedef struct apr_sha1_ctx_t apr_sha1_ctx_t
 

Functions

 APU_DECLARE (void) apr_sha1_base64(const char *clear
 

Variables

int len
 
int charout
 
const charinput
 
const char unsigned int inputLen
 
apr_sha1_ctx_tcontext
 

Detailed Description

APR-UTIL SHA1 library.

Definition in file apr_sha1.h.

Macro Definition Documentation

◆ APR_SHA1_DIGESTSIZE

#define APR_SHA1_DIGESTSIZE   20

size of the SHA1 DIGEST

Definition at line 39 of file apr_sha1.h.

◆ APR_SHA1PW_ID

#define APR_SHA1PW_ID   "{SHA}"

Define the Magic String prefix that identifies a password as being hashed using our algorithm.

Definition at line 45 of file apr_sha1.h.

◆ APR_SHA1PW_IDLEN

#define APR_SHA1PW_IDLEN   5

length of the SHA Password

Definition at line 48 of file apr_sha1.h.

Typedef Documentation

◆ apr_sha1_ctx_t

See also
apr_sha1_ctx_t

Definition at line 51 of file apr_sha1.h.

Function Documentation

◆ APU_DECLARE()

APU_DECLARE ( void  ) const

Provide a means to SHA1 crypt/encode a plaintext password in a way which makes password file compatible with those commonly use in netscape web and ldap installations.

Parameters
clearThe plaintext password
lenThe length of the plaintext password
outThe encrypted/encoded password
Note
SHA1 support is useful for migration purposes, but is less secure than Apache's password format, since Apache's (MD5) password format uses a random eight character salt to generate one of many possible hashes for the same password. Netscape uses plain SHA1 without a salt, so the same password will always generate the same hash, making it easier to break since the search space is smaller.

Initialize the SHA digest

Parameters
contextThe SHA context to initialize

Update the SHA digest

Parameters
contextThe SHA1 context to update
inputThe buffer to add to the SHA digest
inputLenThe length of the input buffer

Update the SHA digest with binary data

Parameters
contextThe SHA1 context to update
inputThe buffer to add to the SHA digest
inputLenThe length of the input buffer

Finish computing the SHA digest

Parameters
digestthe output buffer in which to store the digest
contextThe context to finalize

Variable Documentation

◆ context

apr_sha1_ctx_t* context

Definition at line 115 of file apr_sha1.h.

◆ input

Definition at line 96 of file apr_sha1.h.

◆ inputLen

Definition at line 97 of file apr_sha1.h.

◆ len

int len

Definition at line 82 of file apr_sha1.h.

◆ out

int char* out

Definition at line 82 of file apr_sha1.h.