Subversion Repositories MLServ

Rev

Rev 8 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8 Rev 9
Line 1... Line 1...
1
/* $Id: crypt.c 8 2024-09-25 00:57:33Z nishi $ */
1
/* $Id: crypt.c 9 2024-09-25 01:17:09Z nishi $ */
2
 
2
 
3
#include "cm_crypt.h"
3
#include "cm_crypt.h"
4
 
4
 
5
#include <unistd.h>
5
#include <unistd.h>
6
#include <stdio.h>
6
#include <stdio.h>
Line 100... Line 100...
100
	const char usable[] = "0123456789abcdefghijklmnopqrstuvwxyz";
100
	const char usable[] = "0123456789abcdefghijklmnopqrstuvwxyz";
101
	for(i = 0; i < 64; i++) {
101
	for(i = 0; i < 64; i++) {
102
		fread(&c, 1, 1, f);
102
		fread(&c, 1, 1, f);
103
		salt[i] = c % strlen(usable);
103
		salt[i] = c % strlen(usable);
104
	}
104
	}
-
 
105
#ifdef __NetBSD__
-
 
106
	if(cm_chosen_crypt == C_ARGON2) {
-
 
107
		salt[16] = 0;
-
 
108
	}
-
 
109
#endif
105
	fclose(f);
110
	fclose(f);
106
	return cm_crypt_spec(cm_chosen_crypt, string, salt);
111
	return cm_crypt_spec(cm_chosen_crypt, string, salt);
107
}
112
}