OLD | NEW |
1 /* crypto/x509/x509type.c */ | 1 /* crypto/x509/x509type.c */ |
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 * |
5 * This package is an SSL implementation written | 5 * This package is an SSL implementation written |
6 * by Eric Young (eay@cryptsoft.com). | 6 * by Eric Young (eay@cryptsoft.com). |
7 * The implementation was written so as to conform with Netscapes SSL. | 7 * The implementation was written so as to conform with Netscapes SSL. |
8 * | 8 * |
9 * This library is free for commercial and non-commercial use as long as | 9 * This library is free for commercial and non-commercial use as long as |
10 * the following conditions are aheared to. The following conditions | 10 * the following conditions are aheared to. The following conditions |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 ret|=EVP_PKT_ENC; | 84 ret|=EVP_PKT_ENC; |
85 break; | 85 break; |
86 case EVP_PKEY_DSA: | 86 case EVP_PKEY_DSA: |
87 ret=EVP_PK_DSA|EVP_PKT_SIGN; | 87 ret=EVP_PK_DSA|EVP_PKT_SIGN; |
88 break; | 88 break; |
89 case EVP_PKEY_EC: | 89 case EVP_PKEY_EC: |
90 ret=EVP_PK_EC|EVP_PKT_SIGN|EVP_PKT_EXCH; | 90 ret=EVP_PK_EC|EVP_PKT_SIGN|EVP_PKT_EXCH; |
91 break; | 91 break; |
92 case EVP_PKEY_DH: | 92 case EVP_PKEY_DH: |
93 ret=EVP_PK_DH|EVP_PKT_EXCH; | 93 ret=EVP_PK_DH|EVP_PKT_EXCH; |
| 94 break; |
| 95 case NID_id_GostR3410_94: |
| 96 case NID_id_GostR3410_2001: |
| 97 ret=EVP_PKT_EXCH|EVP_PKT_SIGN; |
94 break; | 98 break; |
95 default: | 99 default: |
96 break; | 100 break; |
97 } | 101 } |
98 | 102 |
99 i=X509_get_signature_type(x); | 103 i=X509_get_signature_type(x); |
100 switch (i) | 104 switch (i) |
101 { | 105 { |
102 case EVP_PKEY_RSA: | 106 case EVP_PKEY_RSA: |
103 ret|=EVP_PKS_RSA; | 107 ret|=EVP_PKS_RSA; |
104 break; | 108 break; |
105 case EVP_PKEY_DSA: | 109 case EVP_PKEY_DSA: |
106 ret|=EVP_PKS_DSA; | 110 ret|=EVP_PKS_DSA; |
107 break; | 111 break; |
108 case EVP_PKEY_EC: | 112 case EVP_PKEY_EC: |
109 ret|=EVP_PKS_EC; | 113 ret|=EVP_PKS_EC; |
110 break; | 114 break; |
111 default: | 115 default: |
112 break; | 116 break; |
113 } | 117 } |
114 | 118 |
115 if (EVP_PKEY_size(pk) <= 1024/8)/* /8 because it's 1024 bits we look | 119 if (EVP_PKEY_size(pk) <= 1024/8)/* /8 because it's 1024 bits we look |
116 for, not bytes */ | 120 for, not bytes */ |
117 ret|=EVP_PKT_EXP; | 121 ret|=EVP_PKT_EXP; |
118 if(pkey==NULL) EVP_PKEY_free(pk); | 122 if(pkey==NULL) EVP_PKEY_free(pk); |
119 return(ret); | 123 return(ret); |
120 } | 124 } |
121 | 125 |
OLD | NEW |