Exemple #1
0
int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
	{
	int i=0,l;

	if (type != NULL) 
		{
		l=EVP_CIPHER_CTX_iv_length(c);
		OPENSSL_assert(l <= sizeof c->iv);
		i=ASN1_TYPE_get_octetstring(type,c->oiv,l);
		if (i != l)
			return(-1);
		else if (i > 0)
			memcpy(c->iv,c->oiv,l);
		}
	return(i);
	}
Exemple #2
0
int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
	{
	int i=0;
	unsigned int l;

	if (type != NULL) 
		{
		l=EVP_CIPHER_CTX_iv_length(c);
		OPENSSL_assert(l <= sizeof(c->iv));
		i=ASN1_TYPE_get_octetstring(type,c->oiv,l);
		if (i != (int)l)
			return(-1);
		else if (i > 0)
			TINYCLR_SSL_MEMCPY(c->iv,c->oiv,l);
		}
	return(i);
	}