pkcs5: Add missing break statements when checking crypto primitives
[strongswan.git] / scripts / crypt_burn.c
index 1f1536a..8101f9c 100644 (file)
@@ -15,7 +15,6 @@
 
 #include <stdio.h>
 #include <library.h>
-#include <crypto/proposal/proposal_keywords.h>
 
 int main(int argc, char *argv[])
 {
@@ -28,7 +27,7 @@ int main(int argc, char *argv[])
 
 
        library_init(NULL);
-       lib->plugins->load(lib->plugins, NULL, PLUGINS);
+       lib->plugins->load(lib->plugins, PLUGINS);
        atexit(library_deinit);
 
        printf("loaded: %s\n", PLUGINS);
@@ -47,7 +46,7 @@ int main(int argc, char *argv[])
                limit = atoi(argv[2]);
        }
 
-       token = proposal_get_token(argv[1], strlen(argv[1]));
+       token = lib->proposal->get_token(lib->proposal, argv[1]);
        if (!token)
        {
                fprintf(stderr, "algorithm '%s' unknown!\n", argv[1]);
@@ -90,6 +89,7 @@ int main(int argc, char *argv[])
                                break;
                        }
                }
+               aead->destroy(aead);
        }
        else
        {
@@ -102,7 +102,7 @@ int main(int argc, char *argv[])
                }
                bs = crypter->get_block_size(crypter);
 
-               while (i--)
+               while (TRUE)
                {
                        if (!crypter->encrypt(crypter,
                                        chunk_create(buffer, sizeof(buffer) / bs * bs),
@@ -121,6 +121,7 @@ int main(int argc, char *argv[])
                                break;
                        }
                }
+               crypter->destroy(crypter);
        }
        return 0;
 }