...
Code Block | ||
---|---|---|
| ||
#include <resource.h> /* ... */ struct rlimit limit; limit.rlim_cur = 0; limit.rlim_max = 0; if(!setrlimit(RLIMIT_CORE, &limit)) { /* Handle Error */ } if(mlock(pwdsecret, MAX_PWD_LENsizeof(secret)) != 0) { /* Handle error */ } /* Create or otherwise obtain some sensitive data */ fgets(secret, sizeof(secret), stdin); |
...
Code Block | ||
---|---|---|
| ||
#include <resource.h> /* ... */ struct rlimit limit; limit.rlim_cur = 0; limit.rlim_max = 0; if(!setrlimit(RLIMIT_CORE, &limit)) { /* Handle Error */ } if(VirtualLock(pwdsecret, MAX_PWD_LENsizeof(secret)) != 0) { /* Handle error */ } /* Create or otherwise obtain some sensitive data */ fgets(secret, sizeof(secret), stdin); |
...