cleaned up some code that Andreas thought was ugly.

This commit is contained in:
Brian Wellington 2001-02-15 20:10:04 +00:00
parent e51477c9c4
commit 7bd7a2a798
2 changed files with 11 additions and 9 deletions

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: auth.c,v 1.17 2001/02/15 19:44:41 bwelling Exp $ */
/* $Id: auth.c,v 1.18 2001/02/15 20:10:03 bwelling Exp $ */
/* Principal Author: DCL */
@ -105,12 +105,13 @@ auth_find(const char *name, unsigned int algorithm, auth_t **ap) {
isc_result_t
auth_makekey(const char *name, unsigned int algorithm, isc_region_t **key) {
auth_makekey(const char *name, unsigned int algorithm, isc_region_t **keyp) {
isc_result_t result;
auth_t *auth = NULL;
isc_region_t *key;
REQUIRE(name != NULL && algorithm != 0);
REQUIRE(key != NULL && *key == NULL);
REQUIRE(keyp != NULL && *keyp == NULL);
RUNTIME_CHECK(isc_once_do(&once, initialize_mutex) == ISC_R_SUCCESS);
LOCK(&mutex);
@ -127,13 +128,14 @@ auth_makekey(const char *name, unsigned int algorithm, isc_region_t **key) {
return (ISC_R_UNEXPECTED);
}
*key = isc_mem_get(omapi_mctx, sizeof(isc_region_t));
if (*key == NULL)
key = isc_mem_get(omapi_mctx, sizeof(isc_region_t));
if (key == NULL)
result = ISC_R_NOMEMORY;
if (result == ISC_R_SUCCESS) {
(*key)->base = auth->secret;
(*key)->length = auth->secretlen;
key->base = auth->secret;
key->length = auth->secretlen;
*keyp = key;
}
}

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: private.h,v 1.27 2001/02/15 19:44:46 bwelling Exp $ */
/* $Id: private.h,v 1.28 2001/02/15 20:10:04 bwelling Exp $ */
/*****
***** Private master include file for the OMAPI library.
@ -307,7 +307,7 @@ auth_destroy(void);
#define auth_makekey omapi__auth_makekey
isc_result_t
auth_makekey(const char *name, unsigned int algorithm, isc_region_t **key);
auth_makekey(const char *name, unsigned int algorithm, isc_region_t **keyp);
/*
* Private library functions defined in connection.c.