MagickCore 7.0.10
|
#include "wizard/studio.h"
#include "wizard/cipher.h"
#include "wizard/exception.h"
#include "wizard/exception-private.h"
#include "wizard/hmac.h"
#include "wizard/keyring.h"
#include "wizard/memory_.h"
#include "wizard/passphrase.h"
#include "wizard/random_.h"
#include "wizard/secret.h"
Go to the source code of this file.
Data Structures | |
struct | _SecretInfo |
Macros | |
#define | SecretKeyCipher AESCipher |
#define | SecretKeyMode CTRMode |
#define | SecretKeyHash SHA2256Hash |
#define | SecretRandomHash SHA2256Hash |
Functions | |
WizardExport SecretInfo * | AcquireSecretInfo (const char *path, const HashType hash, const size_t key_length) |
WizardExport WizardBooleanType | AuthenticateSecretKey (SecretInfo *secret_info, ExceptionInfo *exception) |
WizardExport SecretInfo * | DestroySecretInfo (SecretInfo *secret_info) |
WizardExport WizardBooleanType | GenerateSecretKey (SecretInfo *secret_info, ExceptionInfo *exception) |
WizardExport const StringInfo * | GetSecretId (const SecretInfo *secret_info) |
WizardExport const StringInfo * | GetSecretKey (const SecretInfo *secret_info) |
WizardExport size_t | GetSecretKeyLength (const SecretInfo *secret_info) |
WizardExport const char * | GetSecretPassphrase (const SecretInfo *secret_info) |
WizardExport void | SetSecretId (SecretInfo *secret_info, const StringInfo *id) |
WizardExport void | SetSecretKeyLength (SecretInfo *secret_info, const size_t key_length) |
WizardExport void | SetSecretPassphrase (SecretInfo *secret_info, const char *passphrase) |
#define SecretKeyHash SHA2256Hash |
#define SecretRandomHash SHA2256Hash |
WizardExport SecretInfo * AcquireSecretInfo | ( | const char * | path, |
const HashType | hash, | ||
const size_t | key_length | ||
) |
Definition at line 124 of file secret.c.
References AcquireCipherInfo(), AcquireHMACInfo(), AcquireKeyringInfo(), AcquireRandomInfo(), AcquireWizardMemory(), AuthenticateDomain, _SecretInfo::cipher_info, GenerateCipherNonce(), _SecretInfo::hmac_info, _SecretInfo::key_length, _SecretInfo::keyring_info, MemoryError, _SecretInfo::nonce, _SecretInfo::random_info, SecretKeyCipher, SecretKeyMode, SecretRandomHash, _SecretInfo::signature, ThrowWizardFatalError, _SecretInfo::timestamp, and WizardSignature.
Referenced by AcquireAuthenticateInfo().
WizardExport WizardBooleanType AuthenticateSecretKey | ( | SecretInfo * | secret_info, |
ExceptionInfo * | exception | ||
) |
Definition at line 170 of file secret.c.
References AuthenticateDomain, _SecretInfo::cipher_info, CloneStringInfo(), CompareStringInfo(), ConstructHMAC(), DecipherCipher(), DestroyStringInfo(), ExportKeyringKey(), FileToStringInfo(), GetHMACDigest(), GetKeyringKey(), GetKeyringNonce(), GetPassphrase(), GetWizardModule, _SecretInfo::hmac_info, _SecretInfo::id, _SecretInfo::key, _SecretInfo::keyring_info, LogWizardEvent(), _SecretInfo::passphrase, SetCipherKey(), SetCipherNonce(), SetKeyringId(), _SecretInfo::signature, TraceEvent, WizardAssert, WizardFalse, WizardSignature, and WizardTrue.
Referenced by AuthenticateKey().
WizardExport SecretInfo * DestroySecretInfo | ( | SecretInfo * | secret_info | ) |
Definition at line 234 of file secret.c.
References AuthenticateDomain, _SecretInfo::cipher_info, DestroyCipherInfo(), DestroyHMACInfo(), DestroyKeyringInfo(), DestroyRandomInfo(), DestroyStringInfo(), _SecretInfo::digest, GetWizardModule, _SecretInfo::hmac_info, _SecretInfo::id, _SecretInfo::key, _SecretInfo::keyring_info, LogWizardEvent(), _SecretInfo::nonce, _SecretInfo::random_info, RelinquishWizardMemory(), _SecretInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by DestroyAuthenticateInfo().
WizardExport WizardBooleanType GenerateSecretKey | ( | SecretInfo * | secret_info, |
ExceptionInfo * | exception | ||
) |
Definition at line 286 of file secret.c.
References AcquireExceptionInfo(), AuthenticateDomain, _SecretInfo::cipher_info, CloneStringInfo(), ConstructHMAC(), DestroyExceptionInfo(), DestroyStringInfo(), EncipherCipher(), ExportKeyringKey(), FileToStringInfo(), GetHMACDigest(), GetKeyringKey(), GetKeyringNonce(), GetPassphrase(), GetRandomKey(), GetWizardModule, _SecretInfo::hmac_info, _SecretInfo::id, ImportKeyringKey(), _SecretInfo::key, _SecretInfo::key_length, _SecretInfo::keyring_info, LogWizardEvent(), _SecretInfo::nonce, _SecretInfo::passphrase, _SecretInfo::random_info, SetCipherKey(), SetCipherNonce(), SetKeyringId(), SetKeyringKey(), SetKeyringNonce(), _SecretInfo::signature, TraceEvent, WizardAssert, WizardFalse, WizardSignature, and WizardTrue.
Referenced by GenerateAuthenticateKey().
WizardExport const StringInfo * GetSecretId | ( | const SecretInfo * | secret_info | ) |
Definition at line 360 of file secret.c.
References AuthenticateDomain, GetWizardModule, _SecretInfo::id, LogWizardEvent(), _SecretInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by GetAuthenticateId().
WizardExport const StringInfo * GetSecretKey | ( | const SecretInfo * | secret_info | ) |
Definition at line 390 of file secret.c.
References AuthenticateDomain, GetWizardModule, _SecretInfo::key, LogWizardEvent(), _SecretInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by GetAuthenticateKey().
WizardExport size_t GetSecretKeyLength | ( | const SecretInfo * | secret_info | ) |
Definition at line 420 of file secret.c.
References AuthenticateDomain, GetWizardModule, _SecretInfo::key_length, LogWizardEvent(), _SecretInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by GetAuthenticateKeyLength().
WizardExport const char * GetSecretPassphrase | ( | const SecretInfo * | secret_info | ) |
Definition at line 450 of file secret.c.
References AuthenticateDomain, GetWizardModule, LogWizardEvent(), _SecretInfo::passphrase, _SecretInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by GetAuthenticatePassphrase().
WizardExport void SetSecretId | ( | SecretInfo * | secret_info, |
const StringInfo * | id | ||
) |
Definition at line 482 of file secret.c.
References CloneStringInfo(), DestroyStringInfo(), and _SecretInfo::id.
Referenced by SetAuthenticateId().
WizardExport void SetSecretKeyLength | ( | SecretInfo * | secret_info, |
const size_t | key_length | ||
) |
Definition at line 514 of file secret.c.
References AuthenticateDomain, GetWizardModule, _SecretInfo::key_length, LogWizardEvent(), _SecretInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by SetAuthenticateKeyLength().
WizardExport void SetSecretPassphrase | ( | SecretInfo * | secret_info, |
const char * | passphrase | ||
) |
Definition at line 547 of file secret.c.
References ConstantString(), DestroyString(), and _SecretInfo::passphrase.
Referenced by SetAuthenticatePassphrase().