Esempio n. 1
0
void pki_evp::oldFromData(unsigned char *p, int size )
{
	int version, type;

	QByteArray ba;

	version = intFromData(ba);
	if (version != 1) { // backward compatibility
		veryOldFromData(p, size);
		return;
	}
	if (key)
		EVP_PKEY_free(key);

	key = NULL;
	type = intFromData(ba);
	ownPass = intFromData(ba);

	d2i_old(ba, type);
	pki_openssl_error();

	encKey = ba;
}
Esempio n. 2
0
int getPosition(TCan *can, int *pos)
{
	struct can_frame frame;
	unsigned char data[8] = { 0x50, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* PX */
	
	if (sendPDO2(can, 4, data) < 0) {
		return -1;
	}

	if (receivePDO2(can, &frame)) {
		return -2;
	}

	*pos = intFromData(frame.data);
	return 0;
}