QAPI's 'prefix' feature can make the connection between enumeration type and its constants less than obvious. It's best used with restraint. QCryptoHashAlgorithm has a 'prefix' that overrides the generated enumeration constants' prefix to QCRYPTO_HASH_ALG. We could simply drop 'prefix', but then the prefix becomes QCRYPTO_HASH_ALGORITHM, which is rather long. We could additionally rename the type to QCryptoHashAlg, but I think the abbreviation "alg" is less than clear. Rename the type to QCryptoHashAlgo instead. The prefix becomes to QCRYPTO_HASH_ALGO. Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20240904111836.3273842-12-armbru@redhat.com> [Conflicts with merge commit 7bbadc60b58b resolved]
		
			
				
	
	
		
			23 lines
		
	
	
		
			661 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			661 B
		
	
	
	
		
			C
		
	
	
	
	
	
/*
 | 
						|
 * X.509 certificate related helpers
 | 
						|
 *
 | 
						|
 * Copyright (c) 2024 Dorjoy Chowdhury <dorjoychy111@gmail.com>
 | 
						|
 *
 | 
						|
 * This work is licensed under the terms of the GNU GPL, version 2 or
 | 
						|
 * (at your option) any later version.  See the COPYING file in the
 | 
						|
 * top-level directory.
 | 
						|
 */
 | 
						|
 | 
						|
#ifndef QCRYPTO_X509_UTILS_H
 | 
						|
#define QCRYPTO_X509_UTILS_H
 | 
						|
 | 
						|
#include "crypto/hash.h"
 | 
						|
 | 
						|
int qcrypto_get_x509_cert_fingerprint(uint8_t *cert, size_t size,
 | 
						|
                                      QCryptoHashAlgo hash,
 | 
						|
                                      uint8_t *result,
 | 
						|
                                      size_t *resultlen,
 | 
						|
                                      Error **errp);
 | 
						|
 | 
						|
#endif
 |