if you include openssl:
#include <openssl/evp.h>
#include <openssl/sha.h>
#include <openssl/hmac.h>
PMK is calculated by:
PKCS5_PBKDF2_HMAC((const char*)psk, psklen, (unsigned char*)essid, essidlen, 4096, EVP_sha1(), 32, pmk)
successfull if result > 0
PMKID is calculated by:
HMAC(EVP_sha1(), pmk, 32, salt, 20, pmkid, NULL);
successfull if result > 0
and the salt is calculated by:
char *pmkname = "PMK Name";
uint8_t salt[32];
memcpy(&salt, pmkname, 8);
memcpy(&salt[8], mac_ap, 6);
memcpy(&salt[14], mac_sta, 6);
That's all.
#include <openssl/evp.h>
#include <openssl/sha.h>
#include <openssl/hmac.h>
PMK is calculated by:
PKCS5_PBKDF2_HMAC((const char*)psk, psklen, (unsigned char*)essid, essidlen, 4096, EVP_sha1(), 32, pmk)
successfull if result > 0
PMKID is calculated by:
HMAC(EVP_sha1(), pmk, 32, salt, 20, pmkid, NULL);
successfull if result > 0
and the salt is calculated by:
char *pmkname = "PMK Name";
uint8_t salt[32];
memcpy(&salt, pmkname, 8);
memcpy(&salt[8], mac_ap, 6);
memcpy(&salt[14], mac_sta, 6);
That's all.