summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rsa/rsa_sign.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_sign.c')
-rw-r--r--src/lib/libcrypto/rsa/rsa_sign.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_sign.c b/src/lib/libcrypto/rsa/rsa_sign.c
index 28c5571e74..1740494a4c 100644
--- a/src/lib/libcrypto/rsa/rsa_sign.c
+++ b/src/lib/libcrypto/rsa/rsa_sign.c
@@ -58,18 +58,13 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include "bn.h" 61#include <openssl/bn.h>
62#include "rsa.h" 62#include <openssl/rsa.h>
63#include "objects.h" 63#include <openssl/objects.h>
64#include "x509.h" 64#include <openssl/x509.h>
65 65
66int RSA_sign(type,m,m_len,sigret,siglen,rsa) 66int RSA_sign(int type, unsigned char *m, unsigned int m_len,
67int type; 67 unsigned char *sigret, unsigned int *siglen, RSA *rsa)
68unsigned char *m;
69unsigned int m_len;
70unsigned char *sigret;
71unsigned int *siglen;
72RSA *rsa;
73 { 68 {
74 X509_SIG sig; 69 X509_SIG sig;
75 ASN1_TYPE parameter; 70 ASN1_TYPE parameter;
@@ -124,13 +119,8 @@ RSA *rsa;
124 return(ret); 119 return(ret);
125 } 120 }
126 121
127int RSA_verify(dtype, m, m_len, sigbuf, siglen, rsa) 122int RSA_verify(int dtype, unsigned char *m, unsigned int m_len,
128int dtype; 123 unsigned char *sigbuf, unsigned int siglen, RSA *rsa)
129unsigned char *m;
130unsigned int m_len;
131unsigned char *sigbuf;
132unsigned int siglen;
133RSA *rsa;
134 { 124 {
135 int i,ret=0,sigtype; 125 int i,ret=0,sigtype;
136 unsigned char *p,*s; 126 unsigned char *p,*s;
@@ -154,9 +144,11 @@ RSA *rsa;
154 144
155 p=s; 145 p=s;
156 sig=d2i_X509_SIG(NULL,&p,(long)i); 146 sig=d2i_X509_SIG(NULL,&p,(long)i);
147
157 if (sig == NULL) goto err; 148 if (sig == NULL) goto err;
158 sigtype=OBJ_obj2nid(sig->algor->algorithm); 149 sigtype=OBJ_obj2nid(sig->algor->algorithm);
159 150
151
160#ifdef RSA_DEBUG 152#ifdef RSA_DEBUG
161 /* put a backward compatability flag in EAY */ 153 /* put a backward compatability flag in EAY */
162 fprintf(stderr,"in(%s) expect(%s)\n",OBJ_nid2ln(sigtype), 154 fprintf(stderr,"in(%s) expect(%s)\n",OBJ_nid2ln(sigtype),