Loading src/secureid.c +11 −0 Original line number Diff line number Diff line Loading @@ -221,4 +221,15 @@ int printSID(struct SID *sid,char *output,int size){ return written; }; void generateDomainIdentfier(uint32_t* output, int count){ } void setRid(struct SID* sid, uint32_t rid){ sid->SubAuthority[sid->SubAuthorityCount-1]=rid; } int getRid(struct SID* sid){ return sid->SubAuthority[sid->SubAuthorityCount-1]; } src/secureid.h +25 −0 Original line number Diff line number Diff line Loading @@ -137,6 +137,31 @@ extern "C" { */ int printSID(struct SID *sid,char *output,int size); /*! \fn void generateDomainIdentfier(uint32_t *output,int count) \brief This function will genarated domain indentfier numbers \param output a uint32_t array that included the unique number \param count the max size of output */ void generateDomainIdentfier(uint32_t *output,int count); /*! \fn void setRid(struct SID *sid,uint32_t rid) \brief This function will set the real id of a user without domain indentfier \param sid SID struct set will be set the real id \param rid the real id number the will be set */ void setRid(struct SID *sid,uint32_t rid); /*! \fn int getRid(struct SID *sid) \brief This function will get the real id of a user without domain indentfier \param sid SID struct set will be set the real id */ int getRid(struct SID *sid); #ifdef __cplusplus }; #endif test/CMakeLists.txt +6 −0 Original line number Diff line number Diff line Loading @@ -9,3 +9,9 @@ target_link_libraries(copy secureid) add_test(NAME copy COMMAND copy "${CMAKE_SOURCE_DIR}/test/sid.txt") set_tests_properties(copy PROPERTIES WILL_FAIL TRUE) add_executable(rid rid.c) target_link_libraries(rid secureid) add_test(NAME rid COMMAND rid "${CMAKE_SOURCE_DIR}/test/sid.txt") set_tests_properties(rid PROPERTIES WILL_FAIL TRUE) test/parse.c +3 −1 Original line number Diff line number Diff line Loading @@ -73,8 +73,10 @@ int main(int argc, char *argv[]){ int ret=parseSID(sid,line,written); if(ret>=0) if(ret>=0){ printSID(sid,out,512); } destroySID(sid); if(ret>=0 && strcmp(line,out)==0){ printf("Success: %s \n",out); Loading Loading
src/secureid.c +11 −0 Original line number Diff line number Diff line Loading @@ -221,4 +221,15 @@ int printSID(struct SID *sid,char *output,int size){ return written; }; void generateDomainIdentfier(uint32_t* output, int count){ } void setRid(struct SID* sid, uint32_t rid){ sid->SubAuthority[sid->SubAuthorityCount-1]=rid; } int getRid(struct SID* sid){ return sid->SubAuthority[sid->SubAuthorityCount-1]; }
src/secureid.h +25 −0 Original line number Diff line number Diff line Loading @@ -137,6 +137,31 @@ extern "C" { */ int printSID(struct SID *sid,char *output,int size); /*! \fn void generateDomainIdentfier(uint32_t *output,int count) \brief This function will genarated domain indentfier numbers \param output a uint32_t array that included the unique number \param count the max size of output */ void generateDomainIdentfier(uint32_t *output,int count); /*! \fn void setRid(struct SID *sid,uint32_t rid) \brief This function will set the real id of a user without domain indentfier \param sid SID struct set will be set the real id \param rid the real id number the will be set */ void setRid(struct SID *sid,uint32_t rid); /*! \fn int getRid(struct SID *sid) \brief This function will get the real id of a user without domain indentfier \param sid SID struct set will be set the real id */ int getRid(struct SID *sid); #ifdef __cplusplus }; #endif
test/CMakeLists.txt +6 −0 Original line number Diff line number Diff line Loading @@ -9,3 +9,9 @@ target_link_libraries(copy secureid) add_test(NAME copy COMMAND copy "${CMAKE_SOURCE_DIR}/test/sid.txt") set_tests_properties(copy PROPERTIES WILL_FAIL TRUE) add_executable(rid rid.c) target_link_libraries(rid secureid) add_test(NAME rid COMMAND rid "${CMAKE_SOURCE_DIR}/test/sid.txt") set_tests_properties(rid PROPERTIES WILL_FAIL TRUE)
test/parse.c +3 −1 Original line number Diff line number Diff line Loading @@ -73,8 +73,10 @@ int main(int argc, char *argv[]){ int ret=parseSID(sid,line,written); if(ret>=0) if(ret>=0){ printSID(sid,out,512); } destroySID(sid); if(ret>=0 && strcmp(line,out)==0){ printf("Success: %s \n",out); Loading