5 #include <openssl/sha.h>
7 #include "utils/nt_std_t.h"
8 #include "utils/base64.h"
9 #include "utils/crypt.h"
12 BOOL nt_make_sha1_string(const char *org_name,
13 char *outbuf, size_t outbuf_len)
15 assert(outbuf != NULL);
16 assert(outbuf_len > SHA_DIGEST_LENGTH*2+1);
17 assert(org_name != NULL);
20 unsigned char md[SHA_DIGEST_LENGTH];
26 len = strlen(org_name);
28 SHA1_Update(&ctx, org_name, len+1);
30 SHA1_Final(&(md[0]), &ctx);
33 for(i = 0; i < SHA_DIGEST_LENGTH; i++){
34 sprintf(outptr, "%02x", md[i]);
37 while(outptr < (outbuf+outbuf_len)){