diff --git a/src/external/Ripe.cc b/src/external/Ripe.cc
index 6ff9561..a1d1eec 100644
--- a/src/external/Ripe.cc
+++ b/src/external/Ripe.cc
@@ -227,7 +227,7 @@ Ripe::KeyPair Ripe::generateRSAKeyPair(unsigned int length, const std::string& s
         if (secret.empty()) {
             PEM_Save(snk, privateKey);
         } else {
-            PEM_Save(snk, privateKey, rng, PRIVATE_RSA_ALGORITHM, secret.data(), secret.size());
+            PEM_Save(snk, rng, privateKey, PRIVATE_RSA_ALGORITHM, secret.data(), secret.size());
         }
         snk.MessageEnd();
     }
