~ubuntu-branches/ubuntu/lucid/openssl/lucid-proposed

« back to all changes in this revision

Viewing changes to crypto/engine/eng_pkey.c

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2009-06-13 18:15:46 UTC
  • mto: (11.1.5 squeeze)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: james.westby@ubuntu.com-20090613181546-vbfntai3b009dl1u
Tags: upstream-0.9.8k
ImportĀ upstreamĀ versionĀ 0.9.8k

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
        return 1;
70
70
        }
71
71
 
 
72
int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
 
73
                                ENGINE_SSL_CLIENT_CERT_PTR loadssl_f)
 
74
        {
 
75
        e->load_ssl_client_cert = loadssl_f;
 
76
        return 1;
 
77
        }
 
78
 
72
79
ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e)
73
80
        {
74
81
        return e->load_privkey;
79
86
        return e->load_pubkey;
80
87
        }
81
88
 
 
89
ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE *e)
 
90
        {
 
91
        return e->load_ssl_client_cert;
 
92
        }
 
93
 
82
94
/* API functions to load public/private keys */
83
95
 
84
96
EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
152
164
                }
153
165
        return pkey;
154
166
        }
 
167
 
 
168
int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s,
 
169
        STACK_OF(X509_NAME) *ca_dn, X509 **pcert, EVP_PKEY **ppkey,
 
170
        STACK_OF(X509) **pother, UI_METHOD *ui_method, void *callback_data)
 
171
        {
 
172
 
 
173
        if(e == NULL)
 
174
                {
 
175
                ENGINEerr(ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT,
 
176
                        ERR_R_PASSED_NULL_PARAMETER);
 
177
                return 0;
 
178
                }
 
179
        CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
 
180
        if(e->funct_ref == 0)
 
181
                {
 
182
                CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
 
183
                ENGINEerr(ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT,
 
184
                        ENGINE_R_NOT_INITIALISED);
 
185
                return 0;
 
186
                }
 
187
        CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
 
188
        if (!e->load_ssl_client_cert)
 
189
                {
 
190
                ENGINEerr(ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT,
 
191
                        ENGINE_R_NO_LOAD_FUNCTION);
 
192
                return 0;
 
193
                }
 
194
        return e->load_ssl_client_cert(e, s, ca_dn, pcert, ppkey, pother,
 
195
                                        ui_method, callback_data);
 
196
        }