summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/x509_d2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/x509/x509_d2.c')
-rw-r--r--src/lib/libcrypto/x509/x509_d2.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509/x509_d2.c b/src/lib/libcrypto/x509/x509_d2.c
index cc22f4f470..5b0f80adda 100644
--- a/src/lib/libcrypto/x509/x509_d2.c
+++ b/src/lib/libcrypto/x509/x509_d2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_d2.c,v 1.9 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: x509_d2.c,v 1.10 2015/01/22 09:06:39 reyk Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -57,6 +57,7 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <sys/uio.h>
60 61
61#include <openssl/crypto.h> 62#include <openssl/crypto.h>
62#include <openssl/err.h> 63#include <openssl/err.h>
@@ -106,3 +107,22 @@ X509_STORE_load_locations(X509_STORE *ctx, const char *file, const char *path)
106 return (0); 107 return (0);
107 return (1); 108 return (1);
108} 109}
110
111int
112X509_STORE_load_mem(X509_STORE *ctx, void *buf, int len)
113{
114 X509_LOOKUP *lookup;
115 struct iovec iov;
116
117 lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_mem());
118 if (lookup == NULL)
119 return (0);
120
121 iov.iov_base = buf;
122 iov.iov_len = len;
123
124 if (X509_LOOKUP_add_mem(lookup, &iov, X509_FILETYPE_PEM) != 1)
125 return (0);
126
127 return (1);
128}