2 * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
10 #include <openssl/evp.h>
15 * Password based encryption (PBE) table ordering test.
16 * Attempt to look up all supported algorithms.
19 int main(int argc, char **argv)
23 int pbe_type, pbe_nid;
24 int last_type = -1, last_nid = -1;
25 for (i = 0; EVP_PBE_get(&pbe_type, &pbe_nid, i) != 0; i++) {
26 if (EVP_PBE_find(pbe_type, pbe_nid, NULL, NULL, 0) == 0) {
33 /* Error: print out whole table */
34 for (i = 0; EVP_PBE_get(&pbe_type, &pbe_nid, i) != 0; i++) {
35 if (pbe_type > last_type)
37 else if (pbe_type < last_type || pbe_nid < last_nid)
41 fprintf(stderr, "PBE type=%d %d (%s): %s\n", pbe_type, pbe_nid,
42 OBJ_nid2sn(pbe_nid), rv ? "ERROR" : "OK");