summaryrefslogtreecommitdiffstats
path: root/crypto/store/str_lib.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2003-06-26 10:26:42 +0000
committerRichard Levitte <levitte@openssl.org>2003-06-26 10:26:42 +0000
commited5fae580e88ce5612be3152ba739a208c61fcdd (patch)
tree7f38609bfbbf140fd222f3408150c1f294aafd41 /crypto/store/str_lib.c
parentd55141ed7a844b4a0b8c75169267566695642840 (diff)
Implement missing functions.
Have the f parameter to _ctrl functions have the prototype (*)(void) rather than (*)(), for the sake of C++ compilers. Disable unimplemented functionality.
Diffstat (limited to 'crypto/store/str_lib.c')
-rw-r--r--crypto/store/str_lib.c121
1 files changed, 121 insertions, 0 deletions
diff --git a/crypto/store/str_lib.c b/crypto/store/str_lib.c
index 5e6e424ba3..eb9e6426be 100644
--- a/crypto/store/str_lib.c
+++ b/crypto/store/str_lib.c
@@ -184,6 +184,19 @@ void STORE_free(STORE *store)
OPENSSL_free(store);
}
+int STORE_ctrl(STORE *store, int cmd, long i, void *p, void (*f)(void))
+ {
+ if (store == NULL)
+ {
+ STOREerr(STORE_F_CTRL,ERR_R_PASSED_NULL_PARAMETER);
+ return 0;
+ }
+ if (store->meth->ctrl)
+ return store->meth->ctrl(store, cmd, i, p, f);
+ STOREerr(STORE_F_STORE_CTRL,STORE_R_NO_CONTROL_FUNCTION);
+ return 0;
+ }
+
int STORE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
@@ -297,6 +310,24 @@ int STORE_store_certificate(STORE *s, X509 *data, OPENSSL_ITEM attributes[],
return 1;
}
+int STORE_modify_certificate(STORE *s, OPENSSL_ITEM search_attributes[],
+ OPENSSL_ITEM add_attributes[], OPENSSL_ITEM modify_attributes[],
+ OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[])
+ {
+ check_store(s,STORE_F_STORE_MODIFY_CERTIFICATE,
+ modify_object,STORE_R_NO_MODIFY_OBJECT_FUNCTION);
+
+ if (!s->meth->modify_object(s, STORE_OBJECT_TYPE_X509_CERTIFICATE,
+ search_attributes, add_attributes, modify_attributes,
+ delete_attributes, parameters))
+ {
+ STOREerr(STORE_F_STORE_MODIFY_CERTIFICATE,
+ STORE_R_FAILED_MODIFYING_CERTIFICATE);
+ return 0;
+ }
+ return 1;
+ }
+
int STORE_revoke_certificate(STORE *s, OPENSSL_ITEM attributes[],
OPENSSL_ITEM parameters[])
{
@@ -496,6 +527,24 @@ int STORE_store_private_key(STORE *s, EVP_PKEY *data, OPENSSL_ITEM attributes[],
return i;
}
+int STORE_modify_private_key(STORE *s, OPENSSL_ITEM search_attributes[],
+ OPENSSL_ITEM add_attributes[], OPENSSL_ITEM modify_attributes[],
+ OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[])
+ {
+ check_store(s,STORE_F_STORE_MODIFY_PRIVATE_KEY,
+ modify_object,STORE_R_NO_MODIFY_OBJECT_FUNCTION);
+
+ if (!s->meth->modify_object(s, STORE_OBJECT_TYPE_PRIVATE_KEY,
+ search_attributes, add_attributes, modify_attributes,
+ delete_attributes, parameters))
+ {
+ STOREerr(STORE_F_STORE_MODIFY_PRIVATE_KEY,
+ STORE_R_FAILED_MODIFYING_PRIVATE_KEY);
+ return 0;
+ }
+ return 1;
+ }
+
int STORE_revoke_private_key(STORE *s, OPENSSL_ITEM attributes[],
OPENSSL_ITEM parameters[])
{
@@ -673,6 +722,24 @@ int STORE_store_public_key(STORE *s, EVP_PKEY *data, OPENSSL_ITEM attributes[],
return i;
}
+int STORE_modify_public_key(STORE *s, OPENSSL_ITEM search_attributes[],
+ OPENSSL_ITEM add_attributes[], OPENSSL_ITEM modify_attributes[],
+ OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[])
+ {
+ check_store(s,STORE_F_STORE_MODIFY_PUBLIC_KEY,
+ modify_object,STORE_R_NO_MODIFY_OBJECT_FUNCTION);
+
+ if (!s->meth->modify_object(s, STORE_OBJECT_TYPE_PUBLIC_KEY,
+ search_attributes, add_attributes, modify_attributes,
+ delete_attributes, parameters))
+ {
+ STOREerr(STORE_F_STORE_MODIFY_PUBLIC_KEY,
+ STORE_R_FAILED_MODIFYING_PUBLIC_KEY);
+ return 0;
+ }
+ return 1;
+ }
+
int STORE_revoke_public_key(STORE *s, OPENSSL_ITEM attributes[],
OPENSSL_ITEM parameters[])
{
@@ -869,6 +936,24 @@ int STORE_store_crl(STORE *s, X509_CRL *data, OPENSSL_ITEM attributes[],
return i;
}
+int STORE_modify_crl(STORE *s, OPENSSL_ITEM search_attributes[],
+ OPENSSL_ITEM add_attributes[], OPENSSL_ITEM modify_attributes[],
+ OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[])
+ {
+ check_store(s,STORE_F_STORE_MODIFY_CRL,
+ modify_object,STORE_R_NO_MODIFY_OBJECT_FUNCTION);
+
+ if (!s->meth->modify_object(s, STORE_OBJECT_TYPE_X509_CRL,
+ search_attributes, add_attributes, modify_attributes,
+ delete_attributes, parameters))
+ {
+ STOREerr(STORE_F_STORE_MODIFY_CRL,
+ STORE_R_FAILED_MODIFYING_CRL);
+ return 0;
+ }
+ return 1;
+ }
+
int STORE_delete_crl(STORE *s, OPENSSL_ITEM attributes[],
OPENSSL_ITEM parameters[])
{
@@ -989,6 +1074,24 @@ int STORE_store_number(STORE *s, BIGNUM *data, OPENSSL_ITEM attributes[],
return 1;
}
+int STORE_modify_number(STORE *s, OPENSSL_ITEM search_attributes[],
+ OPENSSL_ITEM add_attributes[], OPENSSL_ITEM modify_attributes[],
+ OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[])
+ {
+ check_store(s,STORE_F_STORE_MODIFY_NUMBER,
+ modify_object,STORE_R_NO_MODIFY_OBJECT_FUNCTION);
+
+ if (!s->meth->modify_object(s, STORE_OBJECT_TYPE_NUMBER,
+ search_attributes, add_attributes, modify_attributes,
+ delete_attributes, parameters))
+ {
+ STOREerr(STORE_F_STORE_MODIFY_NUMBER,
+ STORE_R_FAILED_MODIFYING_NUMBER);
+ return 0;
+ }
+ return 1;
+ }
+
BIGNUM *STORE_get_number(STORE *s, OPENSSL_ITEM attributes[],
OPENSSL_ITEM parameters[])
{
@@ -1061,6 +1164,24 @@ int STORE_store_arbitrary(STORE *s, BUF_MEM *data, OPENSSL_ITEM attributes[],
return 1;
}
+int STORE_modify_arbitrary(STORE *s, OPENSSL_ITEM search_attributes[],
+ OPENSSL_ITEM add_attributes[], OPENSSL_ITEM modify_attributes[],
+ OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[])
+ {
+ check_store(s,STORE_F_STORE_MODIFY_ARBITRARY,
+ modify_object,STORE_R_NO_MODIFY_OBJECT_FUNCTION);
+
+ if (!s->meth->modify_object(s, STORE_OBJECT_TYPE_ARBITRARY,
+ search_attributes, add_attributes, modify_attributes,
+ delete_attributes, parameters))
+ {
+ STOREerr(STORE_F_STORE_MODIFY_ARBITRARY,
+ STORE_R_FAILED_MODIFYING_ARBITRARY);
+ return 0;
+ }
+ return 1;
+ }
+
BUF_MEM *STORE_get_arbitrary(STORE *s, OPENSSL_ITEM attributes[],
OPENSSL_ITEM parameters[])
{