본문 바로가기

Apple (아이폰/아이팟터치/아이패드/맥)

iOS OpenVPN crypto_alg 미지원하는 것 있음 (RSA-SHA)

시놀로지 VPN 에서 암호화 알고리즘을 선택할 수 있게 업데이트 됐다고 해서 신나서 바꿔봤다.


보니까 openVPN 초기 암호화는 BF-CBC 를 쓰고 있었고 인증은 SHA1 을 쓰고 있던 상태.

다른 사이트에서 설명을 들어보니 BF-CBC가 아주 맛이 간 알고리즘은 아니지만 최신은 아니라 바꾸는게 좋겠다는 의견이 있네. (https://blog.g3rt.nl/openvpn-security-tips.html) 잘은 모르지만 나도 따라서 AES-256 으로 가기로.


14: Set a stronger cipher

Not required for OpenVPN-NL.

cipher AES-256-CBC

OpenVPN's default encryption algorithm BF-CBC (Blowfish, block-cipher) with a 128-bit (variable) key size. While it's certainly not a terrible or 'broken' cipher like RC4 or single-DES, I prefer a more modern and widely used cipher like AES. Out of all other strong options, I've chosen AES-256-CBC for interoperability with OpenVPN-NL. 



이왕 하는 것, 인증도 SHA1 은 너무 옛날 거란 말이 있어서 RSA-SHA256 으로 가 봤다.

 

15: Use SHA-2 for message authentication

Not required for OpenVPN-NL.

auth SHA-256

Message authentication is what's referred to as HMAC. Using a HMAC is to ensure the encrypted data hasn't been altered in transit. OpenVPN's default setting is SHA-1SHA-1is considered weak since 2005 and Microsoft has announced their deprecation policy for it. The SHA-2 set of hashing algorithms are considered stronger and one should use those in favour of SHA-1 whenever possible. Out of the other strong options, I've chosen SHA-256 for interoperability with OpenVPN-NL.


즐거운 설정놀음 결과물


오랜만에 설정하다보니 VPNConfig 내보내기 해서 다시 적용하는 걸 깜빡하긴 했지만, 어쨌든 맥용 Tunnelblick 3.7.0 (build 4790) 에서는 연결 성공하는 것을 확인함.


그런데 이런??


아이폰용 openVPN 에선 안된다. 헑? ㅆㅂ


iOS openVPN app log 를 보니...

2017-02-27 09:00:04 ----- OpenVPN Start -----

OpenVPN core 3.1.2 ios arm64 64-bit built on Dec  5 2016 12:50:25

2017-02-27 09:00:04 Frame=512/2048/512 mssfix-ctrl=1250

2017-02-27 09:00:04 EVENT: CORE_ERROR crypto_alg: RSA-SHA256: not found [ERR]

2017-02-27 09:00:04 Raw stats on disconnect:

2017-02-27 09:00:04 Performance stats on disconnect:

  CPU usage (microseconds): 1734

  Network bytes per CPU second: 0

  Tunnel bytes per CPU second: 0

2017-02-27 09:00:04 EVENT: DISCONNECT_PENDING

2017-02-27 09:00:04 ----- OpenVPN Stop -----



찾아보니 이런 글이 있네 (https://forums.openvpn.net/viewtopic.php?t=21988)


EVENT: CORE_ERROR crypto_alg: RSA-SHA512: not found (ERR) 

(...)

It looks like your app (1.07) does not support --auth RSA-SHA512

Try without specifying --auth on the server and client. 


이런 젠장...

내건 OpenVPN core 3.1.2 ios arm64 64-bit built on Dec 5 버전인데도 그렇다. (OpenVPN 1.1.1 build 212 (iOS 64-bit)


결국...


인증을 SHA256 으로 하니까 그건 된다. 쩝...

-_-;;;



결론 : iOS 용 openVPN 에서는 인증 알고리즘으로 RSA-SHA 는 미지원함. 그러니까 아이폰을 붙여주려면 서버에서 RSA-SHA 대신 그냥 SHA 라고 써진 걸 골라라.


닭질 결과 안되는게 있다는 것을 안 것이 수확이랄까. 에그...