diff options
| author | markus <> | 2002-09-05 12:51:50 +0000 |
|---|---|---|
| committer | markus <> | 2002-09-05 12:51:50 +0000 |
| commit | 15b5d84f9da2ce4bfae8580e56e34a859f74ad71 (patch) | |
| tree | bf939e82d7fd73cc8a01cf6959002209972091bc /src/lib/libcrypto/pem/pem_sign.c | |
| parent | 027351f729b9e837200dae6e1520cda6577ab930 (diff) | |
| download | openbsd-15b5d84f9da2ce4bfae8580e56e34a859f74ad71.tar.gz openbsd-15b5d84f9da2ce4bfae8580e56e34a859f74ad71.tar.bz2 openbsd-15b5d84f9da2ce4bfae8580e56e34a859f74ad71.zip | |
import openssl-0.9.7-beta1
Diffstat (limited to 'src/lib/libcrypto/pem/pem_sign.c')
| -rw-r--r-- | src/lib/libcrypto/pem/pem_sign.c | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/src/lib/libcrypto/pem/pem_sign.c b/src/lib/libcrypto/pem/pem_sign.c index d56f9f9e14..c3b9808cb2 100644 --- a/src/lib/libcrypto/pem/pem_sign.c +++ b/src/lib/libcrypto/pem/pem_sign.c | |||
| @@ -58,38 +58,31 @@ | |||
| 58 | 58 | ||
| 59 | #include <stdio.h> | 59 | #include <stdio.h> |
| 60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
| 61 | #include "rand.h" | 61 | #include <openssl/rand.h> |
| 62 | #include "evp.h" | 62 | #include <openssl/evp.h> |
| 63 | #include "objects.h" | 63 | #include <openssl/objects.h> |
| 64 | #include "x509.h" | 64 | #include <openssl/x509.h> |
| 65 | #include "pem.h" | 65 | #include <openssl/pem.h> |
| 66 | 66 | ||
| 67 | void PEM_SignInit(ctx,type) | 67 | void PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type) |
| 68 | EVP_MD_CTX *ctx; | ||
| 69 | EVP_MD *type; | ||
| 70 | { | 68 | { |
| 71 | EVP_DigestInit(ctx,type); | 69 | EVP_DigestInit_ex(ctx, type, NULL); |
| 72 | } | 70 | } |
| 73 | 71 | ||
| 74 | void PEM_SignUpdate(ctx,data,count) | 72 | void PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *data, |
| 75 | EVP_MD_CTX *ctx; | 73 | unsigned int count) |
| 76 | unsigned char *data; | ||
| 77 | unsigned int count; | ||
| 78 | { | 74 | { |
| 79 | EVP_DigestUpdate(ctx,data,count); | 75 | EVP_DigestUpdate(ctx,data,count); |
| 80 | } | 76 | } |
| 81 | 77 | ||
| 82 | int PEM_SignFinal(ctx,sigret,siglen,pkey) | 78 | int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, |
| 83 | EVP_MD_CTX *ctx; | 79 | EVP_PKEY *pkey) |
| 84 | unsigned char *sigret; | ||
| 85 | unsigned int *siglen; | ||
| 86 | EVP_PKEY *pkey; | ||
| 87 | { | 80 | { |
| 88 | unsigned char *m; | 81 | unsigned char *m; |
| 89 | int i,ret=0; | 82 | int i,ret=0; |
| 90 | unsigned int m_len; | 83 | unsigned int m_len; |
| 91 | 84 | ||
| 92 | m=(unsigned char *)Malloc(EVP_PKEY_size(pkey)+2); | 85 | m=(unsigned char *)OPENSSL_malloc(EVP_PKEY_size(pkey)+2); |
| 93 | if (m == NULL) | 86 | if (m == NULL) |
| 94 | { | 87 | { |
| 95 | PEMerr(PEM_F_PEM_SIGNFINAL,ERR_R_MALLOC_FAILURE); | 88 | PEMerr(PEM_F_PEM_SIGNFINAL,ERR_R_MALLOC_FAILURE); |
| @@ -103,7 +96,7 @@ EVP_PKEY *pkey; | |||
| 103 | ret=1; | 96 | ret=1; |
| 104 | err: | 97 | err: |
| 105 | /* ctx has been zeroed by EVP_SignFinal() */ | 98 | /* ctx has been zeroed by EVP_SignFinal() */ |
| 106 | if (m != NULL) Free(m); | 99 | if (m != NULL) OPENSSL_free(m); |
| 107 | return(ret); | 100 | return(ret); |
| 108 | } | 101 | } |
| 109 | 102 | ||
