… | |
… | |
910 | rsachallenge k; |
910 | rsachallenge k; |
911 | |
911 | |
912 | if (0 > RSA_private_decrypt (sizeof (p->encr), |
912 | if (0 > RSA_private_decrypt (sizeof (p->encr), |
913 | (unsigned char *)&p->encr, (unsigned char *)&k, |
913 | (unsigned char *)&p->encr, (unsigned char *)&k, |
914 | ::conf.rsa_key, RSA_PKCS1_OAEP_PADDING)) |
914 | ::conf.rsa_key, RSA_PKCS1_OAEP_PADDING)) |
915 | slog (L_ERR, _("%s(%s): challenge illegal or corrupted"), |
915 | slog (L_ERR, _("%s(%s): challenge illegal or corrupted (%s). mismatched key or config file?"), |
916 | conf->nodename, (const char *)rsi); |
916 | conf->nodename, (const char *)rsi, ERR_error_string (ERR_get_error (), 0)); |
917 | else |
917 | else |
918 | { |
918 | { |
919 | delete octx; |
919 | delete octx; |
920 | |
920 | |
921 | octx = new crypto_ctx (k, 1); |
921 | octx = new crypto_ctx (k, 1); |
… | |
… | |
954 | |
954 | |
955 | rsachallenge chg; |
955 | rsachallenge chg; |
956 | |
956 | |
957 | if (!rsa_cache.find (p->id, chg)) |
957 | if (!rsa_cache.find (p->id, chg)) |
958 | { |
958 | { |
959 | slog (L_ERR, _("%s(%s): unrequested auth response"), |
959 | slog (L_ERR, _("%s(%s): unrequested auth response ignored"), |
960 | conf->nodename, (const char *)rsi); |
960 | conf->nodename, (const char *)rsi); |
961 | break; |
961 | break; |
962 | } |
962 | } |
963 | else |
963 | else |
964 | { |
964 | { |
965 | crypto_ctx *cctx = new crypto_ctx (chg, 0); |
965 | crypto_ctx *cctx = new crypto_ctx (chg, 0); |
966 | |
966 | |
967 | if (!p->hmac_chk (cctx)) |
967 | if (!p->hmac_chk (cctx)) |
|
|
968 | { |
968 | slog (L_ERR, _("%s(%s): hmac authentication error on auth response, received invalid packet\n" |
969 | slog (L_ERR, _("%s(%s): hmac authentication error on auth response, received invalid packet\n" |
969 | "could be an attack, or just corruption or an synchronization error"), |
970 | "could be an attack, or just corruption or an synchronization error"), |
970 | conf->nodename, (const char *)rsi); |
971 | conf->nodename, (const char *)rsi); |
|
|
972 | break; |
|
|
973 | } |
971 | else |
974 | else |
972 | { |
975 | { |
973 | rsaresponse h; |
976 | rsaresponse h; |
974 | |
977 | |
975 | rsa_hash (p->id, chg, h); |
978 | rsa_hash (p->id, chg, h); |