Skip to content

Commit

Permalink
More bugfixes and test coverage + bump to 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Fitblip committed Mar 1, 2018
1 parent fba70d1 commit b43b417
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
22 changes: 18 additions & 4 deletions lib/easy_ssl.ex
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,12 @@ defmodule EasySSL do
{:dNSName, dns_name} -> ["DNS:" <> (dns_name |> to_string) | san_list]
{:uniformResourceIdentifier, identifier} -> ["URI:" <> (identifier |> to_string) | san_list]
{:rfc822Name, identifier} -> ["RFC 822Name:" <> (identifier |> to_string) | san_list]
{:directoryName, _sequence} -> san_list
{:iPAddress, ip} -> ["IP:" <> (ip |> ip_to_string) | san_list]

# Basically ignore those
{:directoryName, _sequence} -> san_list
{:otherName, other_name} -> san_list

_ ->
raise("Unhandled SAN entry type #{inspect entry}")
end
Expand All @@ -300,8 +303,12 @@ defmodule EasySSL do
{:uniformResourceIdentifier, identifier} -> ["URI:" <> (identifier |> to_string) | issuer_list]
{:dNSName, dns_name} -> ["DNS:" <> (dns_name |> to_string) | issuer_list]
{:rfc822Name, identifier} -> ["RFC 822Name:" <> (identifier |> to_string) | issuer_list]
{:directoryName, _sequence} -> issuer_list
{:iPAddress, ip} -> ["IP:" <> (ip |> ip_to_string) | issuer_list]

# Ignore these
{:directoryName, _sequence} -> issuer_list
{:otherName, _sequence} -> issuer_list

_ ->
raise("Unhandled IAN entry type #{inspect entry}")
end
Expand Down Expand Up @@ -381,8 +388,15 @@ defmodule EasySSL do
[cps_string | message]

{:PolicyQualifierInfo, {1, 3, 6, 1, 5, 5, 7, 2, 2}, user_notice_data} ->
<<_::binary-size(6), user_notice::binary>> = user_notice_data
[user_notice |> String.replace_prefix("", " User Notice: ") | message]
<<_::binary-size(8), user_notice::binary>> = user_notice_data

user_notice = user_notice
|> String.codepoints
|> Enum.filter(fn(c) -> String.printable?(c) end)
|> Enum.join("")
|> String.replace_prefix("", " User Notice: ")

[user_notice | message]

end
end)
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule EasySSL.MixProject do
[
app: :easy_ssl,
name: "EasySSL",
version: "1.0.1",
version: "1.0.2",
elixir: "~> 1.6",
description: "SSL/X509 parsing for humans.",
deps: deps(),
Expand Down
Binary file added test/data/der/bdfyybd.der
Binary file not shown.
Binary file added test/data/der/guardowatches.der
Binary file not shown.
Binary file added test/data/der/owncloud.biggi-und-marcus.der
Binary file not shown.

0 comments on commit b43b417

Please sign in to comment.