| OLD | NEW |
| 1 /* p12_attr.c */ | 1 /* p12_attr.c */ |
| 2 /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 3 * project 1999. | 3 * project 1999. |
| 4 */ | 4 */ |
| 5 /* ==================================================================== | 5 /* ==================================================================== |
| 6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved. | 6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved. |
| 7 * | 7 * |
| 8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
| 9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
| 10 * are met: | 10 * are met: |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 * This product includes cryptographic software written by Eric Young | 53 * This product includes cryptographic software written by Eric Young |
| 54 * (eay@cryptsoft.com). This product includes software written by Tim | 54 * (eay@cryptsoft.com). This product includes software written by Tim |
| 55 * Hudson (tjh@cryptsoft.com). | 55 * Hudson (tjh@cryptsoft.com). |
| 56 * | 56 * |
| 57 */ | 57 */ |
| 58 | 58 |
| 59 #include <stdio.h> | 59 #include <stdio.h> |
| 60 #include "cryptlib.h" | 60 #include "cryptlib.h" |
| 61 #include <openssl/pkcs12.h> | 61 #include <openssl/pkcs12.h> |
| 62 | 62 |
| 63 #ifdef OPENSSL_SYS_NETWARE | |
| 64 /* Rename these functions to avoid name clashes on NetWare OS */ | |
| 65 #define uni2asc OPENSSL_uni2asc | |
| 66 #define asc2uni OPENSSL_asc2uni | |
| 67 #endif | |
| 68 | |
| 69 /* Add a local keyid to a safebag */ | 63 /* Add a local keyid to a safebag */ |
| 70 | 64 |
| 71 int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, | 65 int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, |
| 72 int namelen) | 66 int namelen) |
| 73 { | 67 { |
| 74 if (X509at_add1_attr_by_NID(&bag->attrib, NID_localKeyID, | 68 if (X509at_add1_attr_by_NID(&bag->attrib, NID_localKeyID, |
| 75 V_ASN1_OCTET_STRING, name, namelen)) | 69 V_ASN1_OCTET_STRING, name, namelen)) |
| 76 return 1; | 70 return 1; |
| 77 else | 71 else |
| 78 return 0; | 72 return 0; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 } | 132 } |
| 139 } | 133 } |
| 140 return NULL; | 134 return NULL; |
| 141 } | 135 } |
| 142 | 136 |
| 143 char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag) | 137 char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag) |
| 144 { | 138 { |
| 145 ASN1_TYPE *atype; | 139 ASN1_TYPE *atype; |
| 146 if (!(atype = PKCS12_get_attr(bag, NID_friendlyName))) return NULL; | 140 if (!(atype = PKCS12_get_attr(bag, NID_friendlyName))) return NULL; |
| 147 if (atype->type != V_ASN1_BMPSTRING) return NULL; | 141 if (atype->type != V_ASN1_BMPSTRING) return NULL; |
| 148 » return uni2asc(atype->value.bmpstring->data, | 142 » return OPENSSL_uni2asc(atype->value.bmpstring->data, |
| 149 atype->value.bmpstring->length); | 143 atype->value.bmpstring->length); |
| 150 } | 144 } |
| 151 | 145 |
| OLD | NEW |