diff options
author | Roman Rakus <rrakus@redhat.com> | 2012-11-07 13:51:28 +0100 |
---|---|---|
committer | Roman Rakus <rrakus@redhat.com> | 2012-11-07 13:51:28 +0100 |
commit | fcba47aa00263ffd0e6372d7de4ce20b04132559 (patch) | |
tree | 98cbb8dbfad898a7bf3bf6fe45a5a08ce5b62708 /src/account/LMI_AccountManagementCapabilitiesProvider.c | |
parent | 0bd973c335dd56a198c05cc2fe2f37c99ac1d961 (diff) | |
download | openlmi-providers-fcba47aa00263ffd0e6372d7de4ce20b04132559.tar.gz openlmi-providers-fcba47aa00263ffd0e6372d7de4ce20b04132559.tar.xz openlmi-providers-fcba47aa00263ffd0e6372d7de4ce20b04132559.zip |
Account: Compiletime definition of supported encrypt algorithms0.0.13
Signed-off-by: Roman Rakus <rrakus@redhat.com>
Diffstat (limited to 'src/account/LMI_AccountManagementCapabilitiesProvider.c')
-rw-r--r-- | src/account/LMI_AccountManagementCapabilitiesProvider.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/account/LMI_AccountManagementCapabilitiesProvider.c b/src/account/LMI_AccountManagementCapabilitiesProvider.c index 391b715..c6be6af 100644 --- a/src/account/LMI_AccountManagementCapabilitiesProvider.c +++ b/src/account/LMI_AccountManagementCapabilitiesProvider.c @@ -22,6 +22,7 @@ #include "macros.h" #include "globals.h" +#include "account_globals.h" #define NAME LAMCNAME @@ -57,6 +58,8 @@ static CMPIStatus LMI_AccountManagementCapabilitiesEnumInstances( const char** properties) { LMI_AccountManagementCapabilities lamc; + int size = 0; /* How many encrypt algorithms we have */ + int i = 0; LMI_AccountManagementCapabilities_Init(&lamc, _cb, KNameSpace(cop)); LMI_AccountManagementCapabilities_Set_ElementNameEditSupported( @@ -75,6 +78,19 @@ static CMPIStatus LMI_AccountManagementCapabilitiesEnumInstances( LMI_AccountManagementCapabilities_Init_SupportedUserPasswordEncryptionAlgorithms(&lamc, 1); LMI_AccountManagementCapabilities_Set_SupportedUserPasswordEncryptionAlgorithms(&lamc, 0, LMI_AccountManagementCapabilities_SupportedUserPasswordEncryptionAlgorithms_Other); + /* Count how many ecrypt algorithms we have */ + while(crypt_algs[size]) size++; + + /* Create a list of other supported password encrypt algorithms */ + if (size > 0) + { + LMI_AccountManagementCapabilities_Init_OtherSupportedUserPasswordEncryptionAlgorithms(&lamc, size); + for (i = 0; i < size; i++) + { + LMI_AccountManagementCapabilities_Set_OtherSupportedUserPasswordEncryptionAlgorithms(&lamc, i, crypt_algs[i]); + } + } + KReturnInstance(cr, lamc); CMReturn(CMPI_RC_OK); } |