Lines Matching defs:hash
160 * Creates a x509v3 extension containing a hash
175 * md: hash algorithm
176 * buf: pointer to the buffer that contains the hash
177 * len: size of the hash in bytes
185 HASH *hash;
190 /* HASH structure containing algorithm + hash */
191 hash = HASH_new();
192 if (hash == NULL) {
196 /* OBJECT_IDENTIFIER with hash algorithm */
199 HASH_free(hash);
204 hash->hashAlgorithm->algorithm = algorithm;
205 hash->hashAlgorithm->parameter = ASN1_TYPE_new();
206 ASN1_TYPE_set(hash->hashAlgorithm->parameter, V_ASN1_NULL, NULL);
208 /* OCTET_STRING with the actual hash */
209 ASN1_OCTET_STRING_set(hash->dataHash, buf, len);
212 sz = i2d_HASH(hash, &p);
214 HASH_free(hash);
223 HASH_free(hash);