Path: blob/main/crypto/krb5/src/ccapi/common/win/cci_os_identifier.c
39566 views
/* ccapi/common/win/cci_os_identifier.c */1/*2* Copyright 2008 Massachusetts Institute of Technology.3* All Rights Reserved.4*5* Export of this software from the United States of America may6* require a specific license from the United States Government.7* It is the responsibility of any person or organization contemplating8* export to obtain such a license before exporting.9*10* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and11* distribute this software and its documentation for any purpose and12* without fee is hereby granted, provided that the above copyright13* notice appear in all copies and that both that copyright notice and14* this permission notice appear in supporting documentation, and that15* the name of M.I.T. not be used in advertising or publicity pertaining16* to distribution of the software without specific, written prior17* permission. Furthermore if you modify this software you must label18* your software as modified software and not distribute it in such a19* fashion that it might be confused with the original M.I.T. software.20* M.I.T. makes no representations about the suitability of21* this software for any purpose. It is provided "as is" without express22* or implied warranty.23*/2425#include "cci_common.h"26#include "cci_os_identifier.h"2728#include <rpc.h>2930/* ------------------------------------------------------------------------ */3132cc_int32 cci_os_identifier_new_uuid (cci_uuid_string_t *out_uuid_string) {33cc_int32 err = ccNoError;34UUID uuid;35char* uuidStringTemp;3637err = UuidCreate(&uuid);3839if (!err) {40err = UuidToString(&uuid, &uuidStringTemp);41}4243if (!err) {44*out_uuid_string = malloc(1+strlen(uuidStringTemp));4546if (*out_uuid_string) {47strcpy(*out_uuid_string, uuidStringTemp);48}4950RpcStringFree(&uuidStringTemp);51}5253cci_debug_printf("cci_os_identifier_new_uuid returning %s", *out_uuid_string);5455return cci_check_error (err);56}5758