From 495f480ded737ca50a469ed12d410b9ff8bce996 Mon Sep 17 00:00:00 2001 From: miod <> Date: Sun, 13 Jul 2014 15:42:42 +0000 Subject: OPENSSL_{malloc,free} -> {malloc,free} --- src/lib/libcrypto/doc/EC_POINT_new.pod | 2 +- src/lib/libcrypto/doc/ERR_get_error.pod | 2 +- src/lib/libcrypto/doc/EVP_PKEY_decrypt.pod | 2 +- src/lib/libcrypto/doc/EVP_PKEY_derive.pod | 2 +- src/lib/libcrypto/doc/EVP_PKEY_encrypt.pod | 2 +- src/lib/libcrypto/doc/EVP_PKEY_sign.pod | 2 +- src/lib/libcrypto/doc/EVP_PKEY_verify_recover.pod | 2 +- src/lib/libcrypto/doc/d2i_X509.pod | 10 +++++----- 8 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/lib/libcrypto') diff --git a/src/lib/libcrypto/doc/EC_POINT_new.pod b/src/lib/libcrypto/doc/EC_POINT_new.pod index 69eb0d1a09..b41ca0ed0c 100644 --- a/src/lib/libcrypto/doc/EC_POINT_new.pod +++ b/src/lib/libcrypto/doc/EC_POINT_new.pod @@ -91,7 +91,7 @@ The function EC_POINT_point2oct must be supplied with a buffer long enough to st octets stored. Calling the function with a NULL buffer will not perform the conversion but will still return the required buffer length. The function EC_POINT_point2hex will allocate sufficient memory to store the hexadecimal string. It is the caller's responsibility to free -this memory with a subsequent call to OPENSSL_free(). +this memory with a subsequent call to free(). =head1 RETURN VALUES diff --git a/src/lib/libcrypto/doc/ERR_get_error.pod b/src/lib/libcrypto/doc/ERR_get_error.pod index 01e196c95f..460a79f3f6 100644 --- a/src/lib/libcrypto/doc/ERR_get_error.pod +++ b/src/lib/libcrypto/doc/ERR_get_error.pod @@ -55,7 +55,7 @@ and *B, unless these are B. *B contains a string if *B&B is true. An application B free the *B pointer (or any other pointers -returned by these functions) with OPENSSL_free() as freeing is handled +returned by these functions) with free() as freeing is handled automatically by the error library. =head1 RETURN VALUES diff --git a/src/lib/libcrypto/doc/EVP_PKEY_decrypt.pod b/src/lib/libcrypto/doc/EVP_PKEY_decrypt.pod index 197878eff7..d22b900024 100644 --- a/src/lib/libcrypto/doc/EVP_PKEY_decrypt.pod +++ b/src/lib/libcrypto/doc/EVP_PKEY_decrypt.pod @@ -67,7 +67,7 @@ Decrypt data using OAEP (for RSA keys): if (EVP_PKEY_decrypt(ctx, NULL, &outlen, in, inlen) <= 0) /* Error */ - out = OPENSSL_malloc(outlen); + out = malloc(outlen); if (!out) /* malloc failure */ diff --git a/src/lib/libcrypto/doc/EVP_PKEY_derive.pod b/src/lib/libcrypto/doc/EVP_PKEY_derive.pod index 2424ce0e54..09654e1b81 100644 --- a/src/lib/libcrypto/doc/EVP_PKEY_derive.pod +++ b/src/lib/libcrypto/doc/EVP_PKEY_derive.pod @@ -68,7 +68,7 @@ Derive shared secret (for example DH or EC keys): if (EVP_PKEY_derive(ctx, NULL, &skeylen) <= 0) /* Error */ - skey = OPENSSL_malloc(skeylen); + skey = malloc(skeylen); if (!skey) /* malloc failure */ diff --git a/src/lib/libcrypto/doc/EVP_PKEY_encrypt.pod b/src/lib/libcrypto/doc/EVP_PKEY_encrypt.pod index f7969c296f..b0bfe5d5dc 100644 --- a/src/lib/libcrypto/doc/EVP_PKEY_encrypt.pod +++ b/src/lib/libcrypto/doc/EVP_PKEY_encrypt.pod @@ -67,7 +67,7 @@ Encrypt data using OAEP (for RSA keys): if (EVP_PKEY_encrypt(ctx, NULL, &outlen, in, inlen) <= 0) /* Error */ - out = OPENSSL_malloc(outlen); + out = malloc(outlen); if (!out) /* malloc failure */ diff --git a/src/lib/libcrypto/doc/EVP_PKEY_sign.pod b/src/lib/libcrypto/doc/EVP_PKEY_sign.pod index fb8e61cf29..1925706d96 100644 --- a/src/lib/libcrypto/doc/EVP_PKEY_sign.pod +++ b/src/lib/libcrypto/doc/EVP_PKEY_sign.pod @@ -69,7 +69,7 @@ Sign data using RSA with PKCS#1 padding and SHA256 digest: if (EVP_PKEY_sign(ctx, NULL, &siglen, md, mdlen) <= 0) /* Error */ - sig = OPENSSL_malloc(siglen); + sig = malloc(siglen); if (!sig) /* malloc failure */ diff --git a/src/lib/libcrypto/doc/EVP_PKEY_verify_recover.pod b/src/lib/libcrypto/doc/EVP_PKEY_verify_recover.pod index 4debf7bff0..095e53ea2f 100644 --- a/src/lib/libcrypto/doc/EVP_PKEY_verify_recover.pod +++ b/src/lib/libcrypto/doc/EVP_PKEY_verify_recover.pod @@ -79,7 +79,7 @@ Recover digest originally signed using PKCS#1 and SHA256 digest: if (EVP_PKEY_verify_recover(ctx, NULL, &routlen, sig, siglen) <= 0) /* Error */ - rout = OPENSSL_malloc(routlen); + rout = malloc(routlen); if (!rout) /* malloc failure */ diff --git a/src/lib/libcrypto/doc/d2i_X509.pod b/src/lib/libcrypto/doc/d2i_X509.pod index e212014ac8..fad4e8c35b 100644 --- a/src/lib/libcrypto/doc/d2i_X509.pod +++ b/src/lib/libcrypto/doc/d2i_X509.pod @@ -91,7 +91,7 @@ Allocate and encode the DER encoding of an X509 structure: len = i2d_X509(x, NULL); - buf = OPENSSL_malloc(len); + buf = malloc(len); if (buf == NULL) /* error */ @@ -159,7 +159,7 @@ mistake is to attempt to use a buffer directly as follows: len = i2d_X509(x, NULL); - buf = OPENSSL_malloc(len); + buf = malloc(len); if (buf == NULL) /* error */ @@ -168,12 +168,12 @@ mistake is to attempt to use a buffer directly as follows: /* Other stuff ... */ - OPENSSL_free(buf); + free(buf); This code will result in B apparently containing garbage because it was incremented after the call to point after the data just written. -Also B will no longer contain the pointer allocated by B -and the subsequent call to B may well crash. +Also B will no longer contain the pointer allocated by B +and the subsequent call to B may well crash. The auto allocation feature (setting buf to NULL) only works on OpenSSL 0.9.7 and later. Attempts to use it on earlier versions will typically -- cgit v1.2.3-55-g6feb