Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * AppArmor security module
0004  *
0005  * This file contains AppArmor policy loading interface function definitions.
0006  *
0007  * Copyright 2013 Canonical Ltd.
0008  */
0009 
0010 #ifndef __APPARMOR_CRYPTO_H
0011 #define __APPARMOR_CRYPTO_H
0012 
0013 #include "policy.h"
0014 
0015 #ifdef CONFIG_SECURITY_APPARMOR_HASH
0016 unsigned int aa_hash_size(void);
0017 char *aa_calc_hash(void *data, size_t len);
0018 int aa_calc_profile_hash(struct aa_profile *profile, u32 version, void *start,
0019              size_t len);
0020 #else
0021 static inline char *aa_calc_hash(void *data, size_t len)
0022 {
0023     return NULL;
0024 }
0025 static inline int aa_calc_profile_hash(struct aa_profile *profile, u32 version,
0026                        void *start, size_t len)
0027 {
0028     return 0;
0029 }
0030 
0031 static inline unsigned int aa_hash_size(void)
0032 {
0033     return 0;
0034 }
0035 #endif
0036 
0037 #endif /* __APPARMOR_CRYPTO_H */