projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change AR to ARX to allow exclusion of fips object modules
[openssl.git]
/
crypto
/
x509v3
/
v3_ia5.c
diff --git
a/crypto/x509v3/v3_ia5.c
b/crypto/x509v3/v3_ia5.c
index 13a1137288e4d6fdc6a5463dfef7ce83648642f0..4ff12b52b54c5cdcdcf658dd86606b0e85555048 100644
(file)
--- a/
crypto/x509v3/v3_ia5.c
+++ b/
crypto/x509v3/v3_ia5.c
@@
-1,5
+1,5
@@
/* v3_ia5.c */
/* v3_ia5.c */
-/* Written by Dr Stephen N Henson (s
henson@bigfoot.com
) for the OpenSSL
+/* Written by Dr Stephen N Henson (s
teve@openssl.org
) for the OpenSSL
* project 1999.
*/
/* ====================================================================
* project 1999.
*/
/* ====================================================================
@@
-56,26
+56,16
@@
*
*/
*
*/
+
#include <stdio.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <pem.h>
-#include <asn1_mac.h>
-#include <err.h>
-#include <objects.h>
-#include <conf.h>
-#include "x509v3.h"
+#include "cryptlib.h"
+#include <openssl/asn1.h>
+#include <openssl/conf.h>
+#include <openssl/x509v3.h>
-#ifndef NOPROTO
-static ASN1_IA5STRING *ia5string_new(void);
static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, ASN1_IA5STRING *ia5);
static ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str);
static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, ASN1_IA5STRING *ia5);
static ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str);
-#else
-static ASN1_IA5STRING *ia5string_new();
-static char *i2s_ASN1_IA5STRING();
-static ASN1_IA5STRING *s2i_ASN1_IA5STRING();
-#endif
-
-X509V3_EXT_METHOD v3_ns_ia5_list[] = {
+const X509V3_EXT_METHOD v3_ns_ia5_list[] = {
EXT_IA5STRING(NID_netscape_base_url),
EXT_IA5STRING(NID_netscape_revocation_url),
EXT_IA5STRING(NID_netscape_ca_revocation_url),
EXT_IA5STRING(NID_netscape_base_url),
EXT_IA5STRING(NID_netscape_revocation_url),
EXT_IA5STRING(NID_netscape_ca_revocation_url),
@@
-87,38
+77,37
@@
EXT_END
};
};
-static ASN1_IA5STRING *ia5string_new(void)
-{
- return ASN1_IA5STRING_new();
-}
-
-static char *i2s_ASN1_IA5STRING(method, ia5)
-X509V3_EXT_METHOD *method;
-ASN1_IA5STRING *ia5;
+static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method,
+ ASN1_IA5STRING *ia5)
{
char *tmp;
if(!ia5 || !ia5->length) return NULL;
{
char *tmp;
if(!ia5 || !ia5->length) return NULL;
- tmp = Malloc(ia5->length + 1);
+ if(!(tmp = OPENSSL_malloc(ia5->length + 1))) {
+ X509V3err(X509V3_F_I2S_ASN1_IA5STRING,ERR_R_MALLOC_FAILURE);
+ return NULL;
+ }
memcpy(tmp, ia5->data, ia5->length);
tmp[ia5->length] = 0;
return tmp;
}
memcpy(tmp, ia5->data, ia5->length);
tmp[ia5->length] = 0;
return tmp;
}
-static ASN1_IA5STRING *s2i_ASN1_IA5STRING(method, ctx, str)
-X509V3_EXT_METHOD *method;
-X509V3_CTX *ctx;
-char *str;
+static ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method,
+ X509V3_CTX *ctx, char *str)
{
ASN1_IA5STRING *ia5;
if(!str) {
X509V3err(X509V3_F_S2I_ASN1_IA5STRING,X509V3_R_INVALID_NULL_ARGUMENT);
return NULL;
}
{
ASN1_IA5STRING *ia5;
if(!str) {
X509V3err(X509V3_F_S2I_ASN1_IA5STRING,X509V3_R_INVALID_NULL_ARGUMENT);
return NULL;
}
- if(!(ia5 = ASN1_IA5STRING_new())) goto err;
- if(!ASN1_STRING_set((ASN1_STRING *)ia5, str, strlen(str))) {
- ASN1_IA5STRING_free(ia5);
+ if(!(ia5 = M_ASN1_IA5STRING_new())) goto err;
+ if(!ASN1_STRING_set((ASN1_STRING *)ia5, (unsigned char*)str,
+ strlen(str))) {
+ M_ASN1_IA5STRING_free(ia5);
goto err;
}
goto err;
}
+#ifdef CHARSET_EBCDIC
+ ebcdic2ascii(ia5->data, ia5->data, ia5->length);
+#endif /*CHARSET_EBCDIC*/
return ia5;
err:
X509V3err(X509V3_F_S2I_ASN1_IA5STRING,ERR_R_MALLOC_FAILURE);
return ia5;
err:
X509V3err(X509V3_F_S2I_ASN1_IA5STRING,ERR_R_MALLOC_FAILURE);