Lines Matching defs:handle

88  *	B_FALSE	- error (return code in handle->bc_error_code, line number
89 * on which the error occurred in handle->bc_error_pos)
92 parse_bootconf(bc_handle_t *handle, const char *bootconf)
99 handle->bc_error_code = BC_E_ACCESS;
104 handle->bc_error_code = BC_E_NVLIST;
114 ++(handle->bc_error_pos);
120 handle->bc_error_code = BC_E_IOERR;
123 handle->bc_error_code = BC_E_TOO_LONG;
158 handle->bc_error_code = BC_E_SYNTAX;
199 handle->bc_error_code = BC_E_SYNTAX;
210 handle->bc_error_code = BC_E_SYNTAX;
224 handle->bc_error_code = BC_E_UNKNOWN_NAME;
232 handle->bc_error_code = BC_E_NVLIST;
242 handle->bc_error_code = BC_E_IOERR;
251 handle->bc_error_code = BC_E_IOERR;
253 if (handle->bc_error_code != BC_E_NOERROR) {
263 handle->bc_nvl = nvl;
273 * B_FALSE - error (return code in handle->bc_error_code)
276 valid_encryption(bc_handle_t *handle, boolean_t *is_encrypted)
278 nvlist_t *nvl = handle->bc_nvl;
294 handle->bc_error_code = BC_E_ENCRYPTION_ILLEGAL;
308 * B_FALSE - error (return code in handle->bc_error_code)
311 valid_signature(bc_handle_t *handle, boolean_t *is_signed)
313 nvlist_t *nvl = handle->bc_nvl;
328 handle->bc_error_code = BC_E_SIGNATURE_ILLEGAL;
343 * B_FALSE - error (return code in handle->bc_error_code)
346 valid_client_authentication(bc_handle_t *handle, boolean_t *is_authenticated)
348 nvlist_t *nvl = handle->bc_nvl;
364 handle->bc_error_code = BC_E_CLIENT_AUTH_ILLEGAL;
377 * B_FALSE - error (return code in handle->bc_error_code)
380 valid_server_authentication(bc_handle_t *handle, boolean_t *is_authenticated)
382 nvlist_t *nvl = handle->bc_nvl;
398 handle->bc_error_code = BC_E_SERVER_AUTH_ILLEGAL;
411 * B_FALSE - error (return code in handle->bc_error_code)
414 valid_root_server(bc_handle_t *handle, boolean_t *is_https)
416 nvlist_t *nvl = handle->bc_nvl;
431 handle->bc_error_code = BC_E_ROOT_SERVER_BAD;
441 handle->bc_error_code = BC_E_ROOT_FILE_ABSENT;
445 handle->bc_error_code = BC_E_ROOT_SERVER_ABSENT;
457 * B_FALSE - error (return code in handle->bc_error_code)
460 valid_boot_logger(bc_handle_t *handle, boolean_t *is_https)
462 nvlist_t *nvl = handle->bc_nvl;
477 handle->bc_error_code = BC_E_BOOT_LOGGER_BAD;
492 * B_FALSE - error (return code in handle->bc_error_code)
495 validate_bootconf(bc_handle_t *handle)
507 if (!valid_encryption(handle, &is_encrypted) ||
508 !valid_signature(handle, &is_signed) ||
509 !valid_client_authentication(handle, &client_is_authenticated) ||
510 !valid_server_authentication(handle, &server_is_authenticated) ||
511 !valid_root_server(handle, &rootserver_is_https) ||
512 !valid_boot_logger(handle, &bootlogger_is_https))
519 handle->bc_error_code = BC_E_ENCRYPTED_NOT_SIGNED;
524 handle->bc_error_code = BC_E_CLIENT_AUTH_NOT_ENCRYPTED;
529 handle->bc_error_code = BC_E_CLIENT_AUTH_NOT_SERVER;
535 handle->bc_error_code = BC_E_SERVER_AUTH_NOT_SIGNED;
540 handle->bc_error_code = BC_E_SERVER_AUTH_NOT_HTTPS;
544 handle->bc_error_code = BC_E_SERVER_AUTH_NOT_HTTP;
547 handle->bc_error_code = BC_E_BOOTLOGGER_AUTH_NOT_HTTP;
560 bootconf_end(bc_handle_t *handle)
562 if (handle->bc_nvl != NULL) {
563 nvlist_free(handle->bc_nvl);
564 handle->bc_nvl = NULL;
569 * bootconf_init() must be called to initialize 'handle' before bootconf_get()
573 bootconf_init(bc_handle_t *handle, const char *bootconf)
576 * Initalise the handle's fields to sensible values.
578 handle->bc_nvl = NULL;
579 handle->bc_error_code = BC_E_NOERROR;
580 handle->bc_error_pos = 0;
592 if (parse_bootconf(handle, bootconf) && validate_bootconf(handle)) {
599 bootconf_end(handle);
612 bootconf_get(bc_handle_t *handle, const char *name)
619 if (handle->bc_nvl != NULL &&
620 nvlist_lookup_string(handle->bc_nvl, (char *)name, &strval) == 0) {