Spelling error.
[oweals/openssl.git] / crypto / evp / evp_pbe.c
index cac4f941df95ad3c0d8962c0a47f65d163d090f3..848edddd8c9257e7393fac30ba838162ca94a5d4 100644 (file)
@@ -57,8 +57,8 @@
  */
 
 #include <stdio.h>
-#include "evp.h"
-#include "x509.h"
+#include <openssl/evp.h>
+#include <openssl/x509.h>
 #include "cryptlib.h"
 
 /* Password based encryption (PBE) functions */
@@ -83,8 +83,7 @@ int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
        unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH];
        int i;
        pbelu.pbe_nid = OBJ_obj2nid(pbe_obj);
-       if ((pbelu.pbe_nid != NID_undef) && pbe_algs) 
-                       i = sk_find (pbe_algs, (char *)&pbelu);
+       if (pbelu.pbe_nid != NID_undef) i = sk_find(pbe_algs, (char *)&pbelu);
        else i = -1;
 
        if (i == -1) {
@@ -95,7 +94,7 @@ int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
                ERR_add_error_data(2, "TYPE=", obj_tmp);
                return 0;
        }
-       if (passlen == -1) passlen = strlen((char *)pass);
+       if (passlen == -1) passlen = strlen(pass);
        pbetmp = (EVP_PBE_CTL *)sk_value (pbe_algs, i);
        i = (*pbetmp->keygen)(pass, passlen, salt, saltlen, iter,
                                         pbetmp->cipher, pbetmp->md, key, iv);
@@ -167,4 +166,5 @@ int EVP_PBE_alg_add (int nid, EVP_CIPHER *cipher, EVP_MD *md,
 void EVP_PBE_cleanup(void)
 {
        sk_pop_free(pbe_algs, FreeFunc);
+       pbe_algs = NULL;
 }